mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-21 05:29:11 +00:00
(svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name.
This commit is contained in:
7
misc.c
7
misc.c
@@ -150,9 +150,14 @@ void InitializeGame(int mode, uint size_x, uint size_y)
|
||||
ResetObjectToPlace();
|
||||
}
|
||||
|
||||
bool IsCustomName(StringID id)
|
||||
{
|
||||
return GB(id, 11, 5) == 15;
|
||||
}
|
||||
|
||||
void DeleteName(StringID id)
|
||||
{
|
||||
if ((id & 0xF800) == 0x7800) {
|
||||
if (IsCustomName(id)) {
|
||||
memset(_name_array[id & 0x1FF], 0, sizeof(_name_array[id & 0x1FF]));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user