Codechange: Don't use globals for return values from vehicle command procs.

This commit is contained in:
Michael Lutz
2021-11-30 23:21:16 +01:00
parent 57b82e2e99
commit 41fa16f325
21 changed files with 88 additions and 118 deletions

View File

@@ -159,8 +159,6 @@ ScriptObject::ActiveInstance::~ActiveInstance()
/* static */ void ScriptObject::SetLastCommandRes(bool res)
{
GetStorage()->last_command_res = res;
/* Also store the results of various global variables */
SetNewVehicleID(_new_vehicle_id);
}
/* static */ bool ScriptObject::GetLastCommandRes()
@@ -178,16 +176,6 @@ ScriptObject::ActiveInstance::~ActiveInstance()
return GetStorage()->last_cmd_ret;
}
/* static */ void ScriptObject::SetNewVehicleID(VehicleID vehicle_id)
{
GetStorage()->new_vehicle_id = vehicle_id;
}
/* static */ VehicleID ScriptObject::GetNewVehicleID()
{
return GetStorage()->new_vehicle_id;
}
/* static */ void ScriptObject::SetAllowDoCommand(bool allow)
{
GetStorage()->allow_do_command = allow;