diff options
author | Tyler Trahan <tyler@tylertrahan.com> | 2021-11-28 07:16:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-28 15:16:42 +0100 |
commit | 802ca4e72231895e9f043a7b380c59dfbba366cd (patch) | |
tree | 3f65113f1b513c0fda4d73e52d4ce1a7ba35d7e7 /src/signs.cpp | |
parent | 6953df7b5e52d749e50275640197e5fc17e2310c (diff) | |
download | openttd-802ca4e72231895e9f043a7b380c59dfbba366cd.tar.xz |
Fix: Don't try to rename OWNER_DEITY signs in-game (#9716)
Diffstat (limited to 'src/signs.cpp')
-rw-r--r-- | src/signs.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/signs.cpp b/src/signs.cpp index 3e0e7a7a3..0f1d7a78f 100644 --- a/src/signs.cpp +++ b/src/signs.cpp @@ -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; +} |