diff options
author | rubidium <rubidium@openttd.org> | 2010-02-20 23:42:11 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-02-20 23:42:11 +0000 |
commit | 2a65f9e4d01ec24920dd56aa39dd7537d9430952 (patch) | |
tree | 678135c423b05dc53bac54fa98ee3440a5a012c3 /src/strgen | |
parent | 44f2ef179d98837c415bf91c131418e655f59ed6 (diff) | |
download | openttd-2a65f9e4d01ec24920dd56aa39dd7537d9430952.tar.xz |
(svn r19180) -Add/Fix: (partial) support for genders for cargos, industries, vehicles, stations, ...; partial because you can't set a gender for a custom string.
Diffstat (limited to 'src/strgen')
-rw-r--r-- | src/strgen/strgen.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 126fcdebc..1048ac09c 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -12,6 +12,7 @@ #include "../stdafx.h" #include "../core/alloc_func.hpp" #include "../core/endian_func.hpp" +#include "../core/math_func.hpp" #include "../string_func.h" #include "../strings_type.h" #include "strgen.h" @@ -407,7 +408,10 @@ static void EmitGender(char *buf, int value) if (words[nw] == NULL) break; } if (nw != _numgenders) error("Bad # of arguments for gender command"); + + assert(IsInsideBS(cmd->value, SCC_CONTROL_START, UINT8_MAX)); PutUtf8(SCC_GENDER_LIST); + PutByte(cmd->value - SCC_CONTROL_START); PutByte(TranslateArgumentIdx(argidx, offset)); EmitWordList(words, nw); } |