Script: Store CommandCost::GetResultData

This commit is contained in:
Jonathan G Rennison
2022-12-03 14:29:37 +00:00
parent 44c4cc80a1
commit dc96fbc573
4 changed files with 24 additions and 0 deletions

View File

@@ -143,6 +143,16 @@ ScriptObject::ActiveInstance::~ActiveInstance()
return GetStorage()->last_cost;
}
/* static */ void ScriptObject::SetLastCommandResultData(uint32 last_result)
{
GetStorage()->last_result = last_result;
}
/* static */ uint32 ScriptObject::GetLastCommandResultData()
{
return GetStorage()->last_result;
}
/* static */ void ScriptObject::SetRoadType(RoadType road_type)
{
GetStorage()->road_type = road_type;
@@ -358,6 +368,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
/* Costs of this operation. */
SetLastCost(res.GetCost());
SetLastCommandResultData(res.GetResultData());
SetLastCommandRes(true);
if (_generating_world) {

View File

@@ -237,6 +237,16 @@ protected:
*/
static Money GetLastCost();
/**
* Set the result data of the last command.
*/
static void SetLastCommandResultData(uint32 last_result);
/**
* Get the result data of the last command.
*/
static uint32 GetLastCommandResultData();
/**
* Set a variable that can be used by callback functions to pass information.
*/