From 5e6923e9369a5a531d9b64da45fcfcc91f7687de 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. --- vehicle.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'vehicle.h') diff --git a/vehicle.h b/vehicle.h index d0e99e969..8083ea53a 100644 --- a/vehicle.h +++ b/vehicle.h @@ -142,7 +142,7 @@ struct Vehicle { StringID string_id; // Displayed string UnitID unitnumber; // unit number, for display purposes only - byte owner; // which player owns the vehicle? + PlayerID owner; // which player owns the vehicle? TileIndex tile; // Current tile index TileIndex dest_tile; // Heading for this tile @@ -188,14 +188,14 @@ struct Vehicle { byte tick_counter;// increased by one for each tick /* Begin Order-stuff */ - Order current_order; //! The current order (+ status, like: loading) - byte cur_order_index; //! The index to the current order + Order current_order; //! The current order (+ status, like: loading) + OrderID cur_order_index; //! The index to the current order - Order *orders; //! Pointer to the first order for this vehicle - byte num_orders; //! How many orders there are in the list + Order *orders; //! Pointer to the first order for this vehicle + OrderID num_orders; //! How many orders there are in the list - Vehicle *next_shared; //! If not NULL, this points to the next vehicle that shared the order - Vehicle *prev_shared; //! If not NULL, this points to the prev vehicle that shared the order + Vehicle *next_shared; //! If not NULL, this points to the next vehicle that shared the order + Vehicle *prev_shared; //! If not NULL, this points to the prev vehicle that shared the order /* End Order-stuff */ // Boundaries for the current position in the world and a next hash link. -- cgit v1.2.3-54-g00ecf