Add debug console command to delete a vehicle ID
This commit is contained in:
@@ -2134,6 +2134,27 @@ DEF_CONSOLE_CMD(ConMergeLinkgraphJobsAsap)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
DEF_CONSOLE_CMD(ConDeleteVehicleID)
|
||||||
|
{
|
||||||
|
if (argc == 0) {
|
||||||
|
IConsoleHelp("Delete vehicle ID, for emergency single-player use only.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc == 2) {
|
||||||
|
uint32 result;
|
||||||
|
if (GetArgumentInteger(&result, argv[1])) {
|
||||||
|
extern void ConsoleRemoveVehicle(VehicleID id);
|
||||||
|
ConsoleRemoveVehicle(result);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
DEF_CONSOLE_CMD(ConGetFullDate)
|
DEF_CONSOLE_CMD(ConGetFullDate)
|
||||||
{
|
{
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
@@ -3382,4 +3403,8 @@ void IConsoleStdLibRegister()
|
|||||||
/* Bug workarounds */
|
/* Bug workarounds */
|
||||||
IConsoleCmdRegister("jgrpp_bug_workaround_unblock_heliports", ConResetBlockedHeliports, ConHookNoNetwork, true);
|
IConsoleCmdRegister("jgrpp_bug_workaround_unblock_heliports", ConResetBlockedHeliports, ConHookNoNetwork, true);
|
||||||
IConsoleCmdRegister("merge_linkgraph_jobs_asap", ConMergeLinkgraphJobsAsap, ConHookNoNetwork, true);
|
IConsoleCmdRegister("merge_linkgraph_jobs_asap", ConMergeLinkgraphJobsAsap, ConHookNoNetwork, true);
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
IConsoleCmdRegister("delete_vehicle_id", ConDeleteVehicleID, ConHookNoNetwork, true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -191,6 +191,12 @@ static void RemoveAndSellVehicle(Vehicle *v, bool give_money)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConsoleRemoveVehicle(VehicleID id)
|
||||||
|
{
|
||||||
|
Vehicle *v = Vehicle::GetIfValid(id);
|
||||||
|
if (v->Previous() == nullptr) RemoveAndSellVehicle(v, false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check all path reservations, and reserve a new path if the current path is invalid.
|
* Check all path reservations, and reserve a new path if the current path is invalid.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user