(svn r11862) -Fix [FS#1559]: when two NewGRFs 'fight' to define the same cargo it could happen that the strings are defined by one cargo and the 'action2' by another and when one assumes that both come from the same NewGRF... So store the GRF ID with the strings. To be extra sure add the same protection mechanism to industries and towns too.

This commit is contained in:
rubidium
2008-01-15 13:19:49 +00:00
parent e0c61a8921
commit fcee6dad93
8 changed files with 102 additions and 34 deletions

View File

@@ -15,7 +15,7 @@
#include "date_type.h"
#include "town_type.h"
#include "industry_type.h"
#include "strings_type.h"
#include "newgrf_string_type.h"
enum {
INVALID_INDUSTRY = 0xFFFF,
@@ -174,11 +174,11 @@ struct IndustrySpec {
byte climate_availability; ///< Bitmask, giving landscape enums as bit position
IndustryBehaviour behaviour; ///< How this industry will behave, and how others entities can use it
byte map_colour; ///< colour used for the small map
StringID name; ///< Displayed name of the industry
StringID new_industry_text; ///< Message appearing when the industry is built
StringID closure_text; ///< Message appearing when the industry closes
StringID production_up_text; ///< Message appearing when the industry's production is increasing
StringID production_down_text; ///< Message appearing when the industry's production is decreasing
GRFMappedStringID name; ///< Displayed name of the industry
GRFMappedStringID new_industry_text; ///< Message appearing when the industry is built
GRFMappedStringID closure_text; ///< Message appearing when the industry closes
GRFMappedStringID production_up_text; ///< Message appearing when the industry's production is increasing
GRFMappedStringID production_down_text; ///< Message appearing when the industry's production is decreasing
byte appear_ingame[NUM_LANDSCAPE]; ///< Probability of appearance in game
byte appear_creation[NUM_LANDSCAPE]; ///< Probability of appearance during map creation
uint8 number_of_sounds; ///< Number of sounds available in the sounds array