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:
Jonathan G Rennison
2020-04-15 17:04:32 +01:00
parent ab99c16601
commit 3f68c73b09
3 changed files with 14 additions and 0 deletions

View File

@@ -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);