Fix #7188: check the validity of command callback for scripts (#7701)

This commit is contained in:
glx22
2019-09-07 18:37:01 +02:00
committed by Charles Pigott
parent 381c2a4587
commit b3fd787959
23 changed files with 97 additions and 36 deletions

View File

@@ -257,11 +257,13 @@ void GameInstance::Died()
* @param tile The tile on which the command was executed.
* @param p1 p1 as given to DoCommandPInternal.
* @param p2 p2 as given to DoCommandPInternal.
* @param cmd cmd as given to DoCommandPInternal.
*/
void CcGame(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
void CcGame(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
{
Game::GetGameInstance()->DoCommandCallback(result, tile, p1, p2);
Game::GetGameInstance()->Continue();
if (Game::GetGameInstance()->DoCommandCallback(result, tile, p1, p2, cmd)) {
Game::GetGameInstance()->Continue();
}
}
CommandCallback *GameInstance::GetDoCommandCallback()