Fix writables in 7.6, fixes #416
This commit is contained in:
parent
83dd92cfec
commit
27db78567b
|
@ -374,8 +374,8 @@ namespace Otc
|
|||
GamePlayerStateU16 = 48,
|
||||
GameNewOutfitProtocol = 49,
|
||||
GamePVPMode = 50,
|
||||
GameWritableDate = 51,
|
||||
|
||||
// 51-100 reserved to be defined in lua
|
||||
LastGameFeature = 101
|
||||
};
|
||||
|
||||
|
|
|
@ -490,9 +490,9 @@ void Game::processCloseTrade()
|
|||
g_lua.callGlobalField("g_game", "onCloseTrade");
|
||||
}
|
||||
|
||||
void Game::processEditText(uint id, int itemId, int maxLength, const std::string& text, const std::string& writter, const std::string& date)
|
||||
void Game::processEditText(uint id, int itemId, int maxLength, const std::string& text, const std::string& writer, const std::string& date)
|
||||
{
|
||||
g_lua.callGlobalField("g_game", "onEditText", id, itemId, maxLength, text, writter, date);
|
||||
g_lua.callGlobalField("g_game", "onEditText", id, itemId, maxLength, text, writer, date);
|
||||
}
|
||||
|
||||
void Game::processEditList(uint id, int doorId, const std::string& text)
|
||||
|
@ -1451,6 +1451,10 @@ void Game::setProtocolVersion(int version)
|
|||
m_features.reset();
|
||||
enableFeature(Otc::GameFormatCreatureName);
|
||||
|
||||
if(version >= 770)
|
||||
{
|
||||
enableFeature(Otc::GameWritableDate); // might not be since 770
|
||||
}
|
||||
|
||||
if(version >= 780)
|
||||
{
|
||||
|
|
|
@ -124,7 +124,7 @@ protected:
|
|||
void processCloseTrade();
|
||||
|
||||
// edit text/list
|
||||
void processEditText(uint id, int itemId, int maxLength, const std::string& text, const std::string& writter, const std::string& date);
|
||||
void processEditText(uint id, int itemId, int maxLength, const std::string& text, const std::string& writer, const std::string& date);
|
||||
void processEditList(uint id, int doorId, const std::string& text);
|
||||
|
||||
// questlog
|
||||
|
|
|
@ -997,10 +997,13 @@ void ProtocolGame::parseEditText(const InputMessagePtr& msg)
|
|||
|
||||
int maxLength = msg->getU16();
|
||||
std::string text = msg->getString();
|
||||
std::string writter = msg->getString();
|
||||
std::string date = msg->getString();
|
||||
|
||||
g_game.processEditText(id, itemId, maxLength, text, writter, date);
|
||||
std::string writer = msg->getString();
|
||||
std::string date = "";
|
||||
if(g_game.getFeature(Otc::GameWritableDate))
|
||||
date = msg->getString();
|
||||
|
||||
g_game.processEditText(id, itemId, maxLength, text, writer, date);
|
||||
}
|
||||
|
||||
void ProtocolGame::parseEditList(const InputMessagePtr& msg)
|
||||
|
|
Loading…
Reference in New Issue