GS: Charge 5000 opcodes to call ScriptTown::FoundTown
This call is very expensive and calling it in a loop when it fails can consume all available CPU time Add a further 50000 charge if a town name cannot be generated
This commit is contained in:
@@ -95,6 +95,11 @@ ScriptController::~ScriptController()
|
||||
return ScriptObject::GetActiveInstance()->GetOpsTillSuspend();
|
||||
}
|
||||
|
||||
/* static */ void ScriptController::DecreaseOps(int amount)
|
||||
{
|
||||
Squirrel::DecreaseOps(ScriptObject::GetActiveInstance()->engine->GetVM(), amount);
|
||||
}
|
||||
|
||||
/* static */ int ScriptController::GetSetting(const char *name)
|
||||
{
|
||||
return ScriptObject::GetActiveInstance()->GetSetting(name);
|
||||
|
Reference in New Issue
Block a user