Show warning dialog if NewGRFs use too many string IDs.

Show when reloading/changing NewGRF config, or starting new game.
This commit is contained in:
Jonathan G Rennison
2016-12-08 23:48:53 +00:00
parent 6f4dbacf3e
commit 20a090b077
8 changed files with 35 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
#include "newgrf_storage.h"
#include "newgrf_text.h"
#include "newgrf_cargo.h"
#include "newgrf_config.h"
#include "string_func.h"
#include "date_type.h"
#include "debug.h"
@@ -674,7 +675,10 @@ StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid_to_add, bool ne
}
/* Too many strings allocated, return empty */
if (id == lengthof(_grf_text)) return STR_EMPTY;
if (id == lengthof(_grf_text)) {
_grf_bug_too_many_strings = true;
return STR_EMPTY;
}
int len;
translatedtext = TranslateTTDPatchCodes(grfid, langid_to_add, allow_newlines, text_to_add, &len);