equal
deleted
inserted
replaced
78 * Allocate a new order |
78 * Allocate a new order |
79 * |
79 * |
80 * @return Order* if a free space is found, else NULL. |
80 * @return Order* if a free space is found, else NULL. |
81 * |
81 * |
82 */ |
82 */ |
83 static Order *AllocateOrder() |
83 static Order *AllocateOrder(void) |
84 { |
84 { |
85 Order *order; |
85 Order *order; |
86 |
86 |
87 FOR_ALL_ORDERS(order) { |
87 FOR_ALL_ORDERS(order) { |
88 if (order->type == OT_NOTHING) { |
88 if (order->type == OT_NOTHING) { |
912 // reserve extra space in savegame here. (currently 10 bytes) |
912 // reserve extra space in savegame here. (currently 10 bytes) |
913 SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 10, 5, 255), |
913 SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 10, 5, 255), |
914 SLE_END() |
914 SLE_END() |
915 }; |
915 }; |
916 |
916 |
917 static void Save_ORDR() |
917 static void Save_ORDR(void) |
918 { |
918 { |
919 Order *order; |
919 Order *order; |
920 |
920 |
921 FOR_ALL_ORDERS(order) { |
921 FOR_ALL_ORDERS(order) { |
922 if (order->type != OT_NOTHING) { |
922 if (order->type != OT_NOTHING) { |
924 SlObject(order, _order_desc); |
924 SlObject(order, _order_desc); |
925 } |
925 } |
926 } |
926 } |
927 } |
927 } |
928 |
928 |
929 static void Load_ORDR() |
929 static void Load_ORDR(void) |
930 { |
930 { |
931 if (_sl.full_version <= 0x501) { |
931 if (_sl.full_version <= 0x501) { |
932 /* Version older than 0x502 did not have a ->next pointer. Convert them |
932 /* Version older than 0x502 did not have a ->next pointer. Convert them |
933 (in the old days, the orderlist was 5000 items big) */ |
933 (in the old days, the orderlist was 5000 items big) */ |
934 uint len = SlGetFieldLength(); |
934 uint len = SlGetFieldLength(); |