Fix: Don't try to rename OWNER_DEITY signs in-game (#9716)

This commit is contained in:
Tyler Trahan
2021-11-28 07:16:42 -07:00
committed by GitHub
parent 6953df7b5e
commit 802ca4e722
4 changed files with 18 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
#include "stdafx.h"
#include "landscape.h"
#include "company_func.h"
#include "signs_base.h"
#include "signs_func.h"
#include "strings_func.h"
@@ -61,3 +62,14 @@ void UpdateAllSignVirtCoords()
si->UpdateVirtCoord();
}
}
/**
* Check if the current company can rename a given sign.
* @param *si The sign in question.
* @return true if the sign can be renamed, else false.
*/
bool CompanyCanRenameSign(const Sign *si)
{
if (si->owner == OWNER_DEITY && _current_company != OWNER_DEITY && _game_mode != GM_EDITOR) return false;
return true;
}