From 442803c30a4fbca4af3b13049617b516ca8ecc69 Mon Sep 17 00:00:00 2001 From: Marc Olzheim Date: Tue, 12 Oct 2004 19:48:53 +0000 Subject: [PATCH] (i_type, I_NONE): shift the enum down 1, so that I_NONE does not need to be skipped or stored in arrays of size I_MAX. I_NONE's int equivalent becomes -1 by this patch, so all array indices of type i_type have been checked not to use I_NONE as index. This change reduces the size of the arrays stored in files. --- include/item.h | 2 +- src/lib/global/item.c | 6 ---- src/lib/global/land.c | 45 ++++++++++++------------ src/lib/global/ship.c | 77 ++++++++++++++++++++--------------------- src/lib/subs/sect.c | 5 ++- src/lib/subs/whatitem.c | 2 +- src/lib/update/bp.c | 3 +- 7 files changed, 65 insertions(+), 75 deletions(-) diff --git a/include/item.h b/include/item.h index c616d0b84..c85f737ff 100644 --- a/include/item.h +++ b/include/item.h @@ -47,7 +47,7 @@ enum { }; typedef enum { - I_NONE, + I_NONE = -1, I_CIVIL, I_MILIT, I_SHELL, diff --git a/src/lib/global/item.c b/src/lib/global/item.c index 7a447cfa3..1371ccb81 100644 --- a/src/lib/global/item.c +++ b/src/lib/global/item.c @@ -31,17 +31,11 @@ * */ -/* - * must be in same order as defines in var.h - */ - #include "misc.h" -#include "var.h" #include "item.h" struct ichrstr ichr[I_MAX + 2] = { /* mnem vtype val sell lbs {in rg wh ur bnk} name */ - {'?', I_NONE, 0, 0, 0, {0, 0, 0, 0, 0}, "unused"}, {'c', I_CIVIL, 1, 0, 1, {1, 10, 10, 10, 10}, "civilians"}, {'m', I_MILIT, 0, 0, 1, {1, 1, 1, 1, 1}, "military"}, {'s', I_SHELL, 5, 1, 1, {1, 1, 10, 1, 1}, "shells"}, diff --git a/src/lib/global/land.c b/src/lib/global/land.c index cd666a8c3..7c85dabea 100644 --- a/src/lib/global/land.c +++ b/src/lib/global/land.c @@ -34,7 +34,6 @@ */ #include "misc.h" -#include "var.h" #include "land.h" struct lchrstr lchr[] = { @@ -46,154 +45,154 @@ struct lchrstr lchr[] = { cargo */ - {{0, 0, 20, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, + {{0, 20, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, "cav cavalry", 10, 5, 0, 0, 0, 30, 500, 1.2, 0.5, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_RECON | L_LIGHT, }, - {{0, 0, 25, 1, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0}, + {{0, 25, 1, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0}, "linf light infantry", 8, 4, 0, 0, 0, 40, 300, 1.0, 1.5, 60, 28, 15, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, L_ASSAULT | L_LIGHT, }, - {{0, 0, 100, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0}, + {{0, 100, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0}, "inf infantry", 10, 5, 0, 0, 0, 50, 500, 1.0, 1.5, 60, 25, 15, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_ASSAULT | L_LIGHT, }, - {{0, 0, 100, 8, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0}, + {{0, 100, 8, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0}, "mtif motor inf", 15, 10, 0, 0, 0, 190, 400, 1.2, 2.2, 60, 33, 17, 1, 3, 0, 0, 0, 2, 3, 13, 1, 0, 0, L_LIGHT, }, - {{0, 0, 100, 8, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0}, + {{0, 100, 8, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0}, "mif mech inf", 15, 10, 0, 0, 0, 190, 800, 1.5, 2.5, 50, 33, 17, 1, 3, 0, 0, 0, 2, 3, 13, 1, 0, 0, L_LIGHT, }, - {{0, 0, 100, 4, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0}, + {{0, 100, 4, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0}, "mar marines", 10, 5, 0, 0, 0, 140, 1000, 1.4, 2.4, 60, 25, 14, 2, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, L_MARINE | L_ASSAULT | L_LIGHT, }, - {{0, 0, 25, 200, 10, 300, 100, 100, 10, 300, 0, 200, 100, 0, 0}, + {{0, 25, 200, 10, 300, 100, 100, 10, 300, 0, 200, 100, 0, 0}, "sup supply", 10, 5, 0, 0, 0, 50, 500, 0.1, 0.2, 80, 25, 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_LIGHT | L_SUPPLY, }, - {{0, 0, 990, 990, 200, 990, 500, 500, 100, 990, 990, 990, 990, 0, 150}, + {{0, 990, 990, 200, 990, 500, 500, 100, 990, 990, 990, 990, 0, 150}, "tra train", 100, 50, 0, 0, 0, 40, 3500, 0.0, 0.0, 120, 10, 25, 3, 0, 0, 0, 0, 0, 0, 0, 0, 5, 12, L_XLIGHT | L_TRAIN | L_HEAVY | L_SUPPLY, }, - {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, "spy infiltrator", 10, 5, 0, 0, 0, 40, 750, 0.0, 0.0, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_ASSAULT | L_RECON | L_LIGHT | L_SPY, }, - {{0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {{0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, "com commando", 10, 5, 0, 0, 0, 55, 1500, 0.0, 0.0, 80, 32, 18, 4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, L_ASSAULT | L_RECON | L_LIGHT | L_SPY, }, - {{0, 0, 20, 5, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, + {{0, 20, 5, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, "aau aa unit", 20, 10, 0, 0, 0, 70, 500, 0.5, 1.0, 60, 18, 20, 1, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, L_FLAK | L_LIGHT, }, - {{0, 0, 25, 40, 10, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0}, + {{0, 25, 40, 10, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0}, "art artillery", 20, 10, 0, 0, 0, 35, 800, 0.1, 0.4, 70, 18, 20, 1, 0, 8, 50, 5, 2, 1, 0, 0, 0, 0, L_LIGHT, }, - {{0, 0, 25, 20, 6, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, + {{0, 25, 20, 6, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, "lat lt artillery", 20, 10, 0, 0, 0, 70, 500, 0.2, 0.6, 60, 30, 18, 1, 1, 5, 10, 3, 1, 1, 0, 0, 0, 0, L_LIGHT, }, - {{0, 0, 25, 80, 12, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0}, + {{0, 25, 80, 12, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0}, "hat hvy artillery", 40, 20, 0, 0, 0, 100, 800, 0.0, 0.2, 60, 12, 20, 1, 0, 11, 99, 8, 4, 1, 0, 0, 0, 0, 0, }, - {{0, 0, 25, 40, 10, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0}, + {{0, 25, 40, 10, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0}, "mat mech artillery", 20, 10, 0, 0, 0, 200, 1000, 0.2, 0.6, 50, 35, 17, 1, 1, 8, 35, 6, 3, 3, 13, 1, 0, 0, L_LIGHT, }, - {{0, 0, 20, 3, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, + {{0, 20, 3, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, "eng engineer", 10, 5, 0, 0, 0, 130, 3000, 1.2, 2.4, 50, 25, 14, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, L_ENGINEER | L_ASSAULT | L_LIGHT, }, - {{0, 0, 20, 4, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0}, + {{0, 20, 4, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0}, "meng mech engineer", 10, 5, 0, 0, 0, 260, 4500, 1.8, 3.5, 45, 33, 15, 3, 3, 0, 0, 0, 1, 5, 25, 2, 0, 0, L_ENGINEER | L_ASSAULT | L_LIGHT, }, - {{0, 0, 50, 4, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0}, + {{0, 50, 4, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0}, "lar lt armor", 10, 5, 0, 0, 0, 150, 600, 2.0, 1.0, 50, 42, 15, 4, 4, 0, 0, 0, 1, 2, 25, 1, 0, 0, L_RECON | L_LIGHT, }, - {{0, 0, 100, 3, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0}, + {{0, 100, 3, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0}, "har hvy armor", 20, 10, 0, 0, 0, 120, 500, 2.0, 0.8, 50, 18, 17, 1, 1, 0, 0, 0, 2, 1, 10, 2, 0, 0, 0, }, - {{0, 0, 50, 4, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0}, + {{0, 50, 4, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0}, "arm armor", 20, 10, 0, 0, 0, 170, 1000, 3.0, 1.5, 40, 33, 16, 2, 2, 0, 0, 0, 1, 2, 13, 1, 0, 0, L_LIGHT, }, - {{0, 0, 50, 4, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0}, + {{0, 50, 4, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0}, "sec security", 10, 5, 0, 0, 0, 170, 600, 1.0, 2.0, 60, 25, 15, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, L_SECURITY | L_LIGHT, }, - {{0, 0, 10, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0}, + {{0, 10, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0}, "rad radar unit", 10, 5, 0, 0, 0, 270, 1000, 0.0, 0.0, 50, 33, 15, 3, 0, 0, 0, 0, 0, 2, 25, 2, 1, 0, diff --git a/src/lib/global/ship.c b/src/lib/global/ship.c index e1f8a61c2..1d8d5adc8 100644 --- a/src/lib/global/ship.c +++ b/src/lib/global/ship.c @@ -46,7 +46,6 @@ */ #include "misc.h" -#include "var.h" #include "ship.h" struct mchrstr mchr[] = { @@ -56,152 +55,152 @@ struct mchrstr mchr[] = { /* c c o e i g g i p p l l */ /* m m r d b e e m l l c u name tech Cost*/ - {{0, 300, 10, 0, 0, 0, 0, 0, 0, 900, 0, 0, 0, 15, 0}, + {{300, 10, 0, 0, 0, 0, 0, 0, 900, 0, 0, 0, 15, 0}, 25, 15, 10, 10, 15, 2, 0, 0, 0, 0, 0, 0, "fb fishing boat", 0, 180, M_FOOD, 0, 0}, - {{0, 300, 10, 0, 0, 0, 0, 0, 0, 900, 0, 0, 0, 15, 0}, + {{300, 10, 0, 0, 0, 0, 0, 0, 900, 0, 0, 0, 15, 0}, 25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "ft fishing trawler", 35, 300, M_FOOD, 0, 0}, - {{0, 600, 50, 300, 50, 0, 0, 0, 0, 900, 0,1400, 900, 250, 0}, + {{600, 50, 300, 50, 0, 0, 0, 0, 900, 0,1400, 900, 250, 0}, 60, 40, 20, 25, 35, 3, 0, 0, 1, 0, 0, 0, "cs cargo ship", 20, 500, M_SUPPLY, 0, 2}, - {{0, 30, 5, 0, 0, 0, 990, 990, 0, 200, 0, 0, 0, 45, 990}, + {{30, 5, 0, 0, 0, 990, 990, 0, 200, 0, 0, 0, 45, 990}, 60, 40, 20, 25, 35, 3, 0, 0, 1, 0, 30, 1, "os ore ship", 20, 500, 0, 0, 0}, - {{0, 20, 80, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0,1200, 0}, + {{20, 80, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0,1200, 0}, 60, 40, 20, 10, 35, 3, 0, 0, 1, 0, 0, 0, "ss slave ship", 0, 300, 0, 0, 0}, - {{0, 50, 50, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0}, + {{50, 50, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0}, 200, 100, 20, 25, 35, 3, 0, 0, 1, 0, 30, 1, "ts trade ship", 30, 1750, M_TRADE, 0, 0}, - {{0, 0, 60, 10, 2, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0}, + {{0, 60, 10, 2, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0}, 30, 30, 50, 25, 25, 3, 1, 1, 1, 0, 0, 0, "frg frigate", 0, 600, M_SEMILAND, 0, 2}, - {{0, 10, 5, 0, 0, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0}, + {{10, 5, 0, 0, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0}, 25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "oe oil exploration boat", 40, 800, M_OIL, 0, 0}, - {{0, 990, 80, 0, 0, 0, 0, 0, 0, 990, 990, 0, 0, 990, 0}, + {{990, 80, 0, 0, 0, 0, 0, 0, 990, 990, 0, 0, 990, 0}, 60, 60, 30, 15, 65, 3, 0, 0, 2, 0, 0, 0, "od oil derrick", 50, 1500, M_OIL, 0, 0}, - {{0, 0, 2, 12, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0}, + {{0, 2, 12, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0}, 20, 10, 10, 38, 10, 2, 1, 1, 0, 0, 4, 1, "pt patrol boat", 40, 300, M_TORP, 0, 0}, - {{0, 0, 100, 40, 5, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0}, + {{0, 100, 40, 5, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0}, 30, 40, 50, 30, 30, 5, 6, 3, 1, 0, 40, 1, "lc light cruiser", 45, 800, M_MINE, 0, 2 }, - {{0, 0, 120, 100, 8, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0}, + {{0, 120, 100, 8, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0}, 40, 50, 70, 30, 30, 5, 8, 4, 1, 0, 30, 1, "hc heavy cruiser", 50, 1200, 0, 0, 4}, - {{0, 0, 120, 20, 4, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0}, + {{0, 120, 20, 4, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0}, 50, 50, 60, 20, 35, 3, 1, 2, 1, 0, 0, 0, "tt troop transport", 10, 800, M_SEMILAND, 0, 2 }, - {{0, 0, 200, 200, 10, 0, 0, 0, 0, 900, 0, 0, 0, 0, 0}, + {{0, 200, 200, 10, 0, 0, 0, 0, 900, 0, 0, 0, 0, 0}, 50, 70, 95, 25, 35, 6, 10, 7, 1, 0, 50, 2, "bb battleship", 45, 1800, 0, 0, 2}, - {{0, 0, 180, 100, 10, 0, 0, 0, 0, 400, 0, 0, 0, 0, 0}, + {{0, 180, 100, 10, 0, 0, 0, 0, 400, 0, 0, 0, 0, 0}, 50, 60, 55, 30, 35, 6, 10, 6, 1, 0, 60, 2, "bbc battlecruiser", 75, 1500, 0, 0, 2}, - {{0, 30, 5, 0, 0, 990, 0, 0, 0, 200, 990, 0, 0, 25, 0}, + {{30, 5, 0, 0, 990, 0, 0, 0, 200, 990, 0, 0, 25, 0}, 60, 40, 75, 25, 45, 3, 0, 0, 1, 0, 30, 1, "tk tanker", 35, 600, M_OILER | M_SUPPLY, 0, 0}, - {{0, 0, 10, 100, 1, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0}, + {{0, 10, 100, 1, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0}, 25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "ms minesweeper", 40, 400, M_MINE | M_SWEEP, 0, 0}, - {{0, 0, 60, 40, 4, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0}, + {{0, 60, 40, 4, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0}, 30, 30, 45, 35, 20, 4, 6, 3, 1, 0, 30, 1, "dd destroyer", 70, 600, M_MINE | M_DCH | M_SONAR, 0, 1}, - {{0, 0, 25, 36, 5, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0}, + {{0, 25, 36, 5, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0}, 30, 30, 25, 20, 5, 4, 3, 3, 0, 0, 30, 1, "sb submarine", 60, 650, M_TORP | M_SUB | M_MINE | M_SONAR, 0, 0}, - {{0, 5, 10, 104, 20, 100, 0, 0, 0, 900, 0, 500, 300, 0, 0}, + {{5, 10, 104, 20, 100, 0, 0, 0, 900, 0, 500, 300, 0, 0}, 40, 40, 50, 30, 2, 3, 0, 0, 0, 0, 50, 2, "sbc cargo submarine", 150, 1200, M_SUPPLY | M_OILER | M_SUB | M_SONAR, 0, 0}, - {{0, 0, 175, 250, 4, 300, 0, 0, 0, 180, 0, 0, 0, 0, 0}, + {{0, 175, 250, 4, 300, 0, 0, 0, 180, 0, 0, 0, 0, 0}, 50, 60, 60, 30, 40, 5, 2, 2, 4, 20, 50, 2, "cal light carrier", 80, 2700, M_FLY, 20, 0}, - {{0, 0, 350, 500, 4, 500, 0, 0, 0, 900, 0, 0, 0, 0, 0}, + {{0, 350, 500, 4, 500, 0, 0, 0, 900, 0, 0, 0, 0, 0}, 60, 70, 80, 35, 40, 7, 2, 2, 10, 40, 120, 3, "car aircraft carrier", 160, 4500, M_FLY, 40, 0}, - {{0, 0, 350, 999, 4, 999, 0, 0, 0, 900, 0, 0, 0, 0, 0}, + {{0, 350, 999, 4, 999, 0, 0, 0, 900, 0, 0, 0, 0, 0}, 70, 80, 100, 45, 40, 9, 2, 2, 20, 4, 0, 0, "can nuc carrier", 305, 8000, M_OILER | M_FLY | M_SUPPLY, 60, 0}, - {{0, 0, 400, 10, 1, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0}, + {{0, 400, 10, 1, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0}, 60, 40, 40, 30, 30, 2, 0, 0, 2, 0, 30, 1, "ls landing ship", 145, 1000, M_LAND, 0, 6}, - {{0, 0, 60, 60, 4, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0}, + {{0, 60, 60, 4, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0}, 40, 30, 50, 35, 30, 5, 2, 2, 4, 0, 40, 1, "af asw frigate", 220, 800, M_TORP | M_SUBT | M_DCH | M_SONAR, 0, 0}, - {{0, 0, 25, 60, 6, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0}, + {{0, 25, 60, 6, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0}, 30, 40, 45, 40, 3, 6, 5, 3, 0, 0, 0, 0, "na nuc attack sub", 260, 1200, M_TORP | M_SUB | M_MINE | M_SONAR | M_SUBT, 0, 0}, - {{0, 0, 100, 80, 6, 40, 0, 0, 0, 500, 0, 0, 0, 0, 0}, + {{0, 100, 80, 6, 40, 0, 0, 0, 500, 0, 0, 0, 0, 0}, 40, 40, 60, 40, 35, 6, 8, 3, 10, 2, 80, 2, "ad asw destroyer", 240, 1500, M_TORP | M_SUBT | M_DCH | M_SONAR, 0, 0}, - {{0, 0, 25, 200, 1, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0}, + {{0, 25, 200, 1, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0}, 30, 40, 55, 35, 2, 6, 0, 0, 0, 0, 0, 0, "nm nuc miss sub", 270, 1500, M_SUB | M_SONAR, 20, 0}, - {{0, 0, 25, 100, 1, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0}, + {{0, 25, 100, 1, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0}, 30, 30, 35, 30, 3, 3, 0, 0, 0, 0, 30, 1, "msb missile sub", 230, 1200, M_SUB | M_SONAR, 10, 0}, - {{0, 0, 5, 100, 3, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0}, + {{0, 5, 100, 3, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0}, 20, 20, 15, 40, 15, 3, 2, 2, 0, 0, 7, 1, "mb missile boat", 180, 500, 0, 10, 0}, - {{0, 0, 60, 220, 4, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0}, + {{0, 60, 220, 4, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0}, 40, 30, 50, 35, 30, 5, 2, 2, 2, 0, 30, 1, "mf missile frigate", 280, 1000, 0, 20, 0}, - {{0, 0, 120, 500, 6, 160, 0, 0, 0, 200, 0, 0, 0, 0, 0}, + {{0, 120, 500, 6, 160, 0, 0, 0, 200, 0, 0, 0, 0, 0}, 50, 50, 70, 35, 35, 8, 8, 6, 8, 8, 35, 1, "mc missile cruiser", 290, 1500, M_ANTIMISSILE, 40, 0}, - {{0, 0, 100, 100, 15, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0}, + {{0, 100, 100, 15, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0}, 50, 60, 80, 35, 30, 6, 1, 8, 1, 0, 60, 2, "aac aa cruiser", 130, 1500, M_ANTIMISSILE, 0, 4}, - {{0, 0, 200, 400, 25, 40, 0, 0, 0, 900, 0, 0, 0, 0, 0}, + {{0, 200, 400, 25, 40, 0, 0, 0, 900, 0, 0, 0, 0, 0}, 50, 60, 80, 35, 30, 6, 1, 16, 30, 2, 0, 0, "agc aegis cruiser", 265, 4000, M_ANTIMISSILE, 32, 0}, - {{0, 0, 200, 400, 8, 40, 0, 0, 0, 900, 0, 0, 0, 0, 0}, + {{0, 200, 400, 8, 40, 0, 0, 0, 900, 0, 0, 0, 0, 0}, 50, 50, 100, 45, 35, 6, 14, 7, 10, 2, 0, 0, "ncr nuc cruiser", 325, 1800, M_ANTIMISSILE, 20, 0}, - {{0, 0, 200, 120, 6, 160, 0, 0, 0, 500, 0, 0, 0, 0, 0}, + {{0, 200, 120, 6, 160, 0, 0, 0, 500, 0, 0, 0, 0, 0}, 50, 50, 80, 45, 35, 9, 10, 4, 25, 8, 0, 0, "nas nuc asw cruiser", 330, 1800, M_TORP | M_SUBT | M_DCH | M_SONAR, 0, 0}, -/* ? c m s g p i d b f o l h u r */ - {{0, 50, 50, 600, 50, 999, 0, 0, 0, 999, 0,1500, 900, 0, 0}, +/* c m s g p i d b f o l h u r */ + {{50, 50, 600, 50, 999, 0, 0, 0, 999, 0,1500, 900, 0, 0}, 60, 40, 40, 45, 35, 6, 0, 0, 10, 2, 0, 0, "nsp nuc supply ship", 360, 1500, M_SUPPLY, 0, 2}, diff --git a/src/lib/subs/sect.c b/src/lib/subs/sect.c index ece3955fb..e9914b59a 100644 --- a/src/lib/subs/sect.c +++ b/src/lib/subs/sect.c @@ -34,7 +34,6 @@ #include "misc.h" #include "player.h" -#include "var.h" #include "sect.h" #include "xy.h" #include "nat.h" @@ -78,9 +77,9 @@ sct_prewrite(int id, s_char *ptr) void item_prewrite(short *item) { - int i; + i_type i; - for (i = 0; i <= I_MAX; ++i) { + for (i = I_NONE + 1; i <= I_MAX; ++i) { if (CANT_HAPPEN(item[i] < 0)) item[i] = 0; else if (CANT_HAPPEN(item[i] > ITEM_MAX)) diff --git a/src/lib/subs/whatitem.c b/src/lib/subs/whatitem.c index 687cff32a..3c6d219f5 100644 --- a/src/lib/subs/whatitem.c +++ b/src/lib/subs/whatitem.c @@ -64,7 +64,7 @@ item_by_name(char *str) { struct ichrstr *ip; - for (ip = &ichr[1]; ip->i_mnem != 0; ip++) { + for (ip = ichr; ip->i_mnem != 0; ip++) { /* FIXME check i_name if str[2]? */ if (*str == ip->i_mnem) return ip; diff --git a/src/lib/update/bp.c b/src/lib/update/bp.c index 8d32c32db..a2f5b1d9f 100644 --- a/src/lib/update/bp.c +++ b/src/lib/update/bp.c @@ -35,14 +35,13 @@ #include "nat.h" #include "file.h" #include "sect.h" -#include "var.h" #include "budg.h" #include "update.h" #include "common.h" #include "optlist.h" static int bud_key[I_MAX + 2] = - { 0, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 7 }; + { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 7 }; int * get_wp(int *bp, struct sctstr *sp, int cm) -- 2.43.0