From b43331c931e2e8f8586080c9d8bee022bfe3aa5b Mon Sep 17 00:00:00 2001 From: Darkvater Date: Wed, 11 May 2005 00:00:27 +0000 Subject: (svn r2290) - CodeChange: protect the next batch of commands. This brings us to a total of 61, which is 53% :) - CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before. - CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions. - CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt. - CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security". Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm. - CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments. --- table/build_industry.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'table') diff --git a/table/build_industry.h b/table/build_industry.h index ffd789037..3cecb1b66 100644 --- a/table/build_industry.h +++ b/table/build_industry.h @@ -1111,6 +1111,13 @@ const byte _industry_type_costs[37] = { 187, 193, 17, 20, 192, 22, 203, 213, 210 }; +const byte _build_industry_types[4][12] = { + { 1, 2, 4, 6, 8, 0, 3, 5, 9, 11, 18 }, + { 1, 14, 4, 13, 7, 0, 3, 9, 11, 15 }, + { 25, 13, 4, 23, 22, 11, 17, 10, 24, 19, 20, 21 }, + { 27, 30, 31, 33, 26, 28, 29, 32, 34, 35, 36 }, +}; + static const byte _industry_create_table_0[] = { 4, 4, -- cgit v1.2.3-70-g09d2