From 2a65f9e4d01ec24920dd56aa39dd7537d9430952 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 20 Feb 2010 23:42:11 +0000 Subject: (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. --- src/strgen/strgen.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/strgen') 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); } -- cgit v1.2.3-54-g00ecf