[btech-checkins] CVS: btechmux/src/hcode/btech aero.move.c,1.7,1.8 autogun.c,1.2,1.3 bsuit.c,1.6,1.7
Brought to you by:
twouters
Update of /cvsroot/btech/btechmux/src/hcode/btech In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19526/src/hcode/btech Modified Files: aero.move.c autogun.c bsuit.c crit.c econ.c hudinfo.c map.bits.c map.conditions.c mech.advanced.c mech.ammodump.c mech.bth.c mech.combat.c mech.combat.misc.c mech.consistency.c mech.h mech.ice.c mech.maps.c mech.move.c mech.notify.c mech.physical.c mech.pickup.c mech.scan.c mech.update.c mech.utils.c p.aero.move.h p.mech.utils.h template.c weapons.fasa.h weapons.h weapons.vrt.h Log Message: Annual (ahem) sync with the BitKeeper btechmux tree (at btechmux.bkbits.net/btechmux). I should sync more often but I've been short on time. If you want to keep in touch with the changes, consider using BK directly. This sync contains these BK changesets (many merged from the stable tree in BitKeeper): # -------------------------------------------- # 03/09/30 th...@st... 1.13.1.12 # Reformat a bit (purely a whitspace change.) # -------------------------------------------- # 03/09/30 th...@st... 1.13.1.13 # Skip sections that have no internals, when calculating weight of a unit. The MUX treats these sections as 'nonexistant' in all other places, too, but it's still possible (albeit difficult) to get something into those sections, eating up phantom weight. # # -------------------------------------------- # 03/09/30 th...@st... 1.24 # Merge # -------------------------------------------- # 03/10/01 th...@st... 1.13.1.14 # Safeguard against a 'shouldn't-happen' scenario that seems to have happened several times now on 3030MUX. (but was probably just generic memory corruption.) # -------------------------------------------- # 03/10/01 th...@st... 1.25 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/01 th...@st... 1.26 # Remove duplicate maps that screw up case-insensitive systems. # -------------------------------------------- # 03/10/01 th...@st... 1.13.1.15 # Remove duplicate maps that screw up case-insensitive systems. # -------------------------------------------- # 03/10/01 th...@st... 1.13.1.16 # Also actally delete these dupes. # -------------------------------------------- # 03/10/01 th...@st... 1.27 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/01 th...@st... 1.13.3.1 # Rather than safeguard against something, do the proper fix :) wcAmmoItems was incremented twice, in some circumstances. That's not very healthy. Remove the safeguard, it serves no purpose other than protect against hardware errors or memory corruption, both of which would cause other problems anyhow. # -------------------------------------------- # 03/10/01 th...@st... 1.13.1.17 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/10/01 th...@st... 1.28 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/01 th...@ce... 1.13.1.18 # Ice glitchfixes: break through it while standing, and don't survive as tank breaking ice. # -------------------------------------------- # 03/10/01 th...@ce... 1.13.1.19 # More ice glitch fixes: properly break ice when picking a unit (but not a MechWarrior) up through it. # -------------------------------------------- # 03/10/01 th...@st... 1.29 # Manual merge. # -------------------------------------------- # 03/10/01 th...@ce... 1.13.1.20 # Wups... don't sink hovertows. # -------------------------------------------- # 03/10/01 th...@st... 1.30 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/05 th...@st... 1.13.1.21 # Make MUX function 'btgetdbrefbyid' accept a map as well as a 'mech as its first argument. # -------------------------------------------- # 03/10/12 th...@st... 1.13.1.22 # - Fix bug in MechPrefs (MUX +bug #1152) and make sure it doesn't happen again. # - Add MechPrefs to xcodevalues. # # -------------------------------------------- # 03/10/12 th...@st... 1.31 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/12 th...@st... 1.13.1.23 # - Consider OOD-ing 'mechs as Jumping 'mechs where appropriate. # -------------------------------------------- # 03/10/14 th...@st... 1.13.1.24 # Add new 'c' option to LRS, for colorized terrain. # -------------------------------------------- # 03/10/14 th...@st... 1.32 # Manual merge. # -------------------------------------------- # 03/10/14 th...@st... 1.13.1.25 # Don't cliff hovers that go from l0 bridge to l1 bridge. # -------------------------------------------- # 03/10/14 th...@st... 1.13.1.26 # Don't drown vehicles that manage to break l0 ice. # -------------------------------------------- # 03/10/14 th...@st... 1.33 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/15 th...@st... 1.13.1.27 # Add tactical/lrs-like argument handling to navigate. You can now say 'navigate 120 1' to see the hex bearing 120 of you as if you were in it, or 'navigate qq' to see the navigate for 'Mech 'qq'. Max range is the same as for 'tactical'. # -------------------------------------------- # 03/10/18 th...@st... 1.13.1.28 # - Add 'tactical b', for displaying valid DropShip landing zones # - Add the ability to run 'checklz x y' for hexes in TacRange. # -------------------------------------------- # 03/10/18 th...@st... 1.34 # Merge 'tactical b' changes. # -------------------------------------------- # 03/10/18 th...@st... 1.35 # Typo fix. # -------------------------------------------- # 03/10/19 th...@st... 1.13.1.29 # - Add new 'btmechfreqs' function, returning the radio freqs on a 'Mech. It returns a comma separated list of entries, each of which is: # # <freqnum> | <frequency> | <freqflags> | <colorcode> # # Where freqnum starts at 1, frequency is the actual frequency set, colormode is the color setting for that channel (captial letters meaning bold), and freqflags is a bitvector-string with the following meaning: # # - 'a': Freq is digital # - 'b': Freq is muted # - 'c': Freq is set Relay # - 'd': Freq is set Info # - 'e': Freq is set Scan # # Comtitles are not returned because of escaping issues. # -------------------------------------------- # 03/10/19 th...@st... 1.36 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/19 th...@st... 1.13.1.30 # Make second argument to 'btstores' optional. When not passed, 'btstores' will return partname:amount pairs, separated by |'s, for all parts in the inventory of the object. # -------------------------------------------- # 03/10/19 th...@st... 1.37 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/19 th...@st... 1.13.1.31 # Patch from Tony to make tel() and @tel 'teleport' exits the same way the 'drop' command does. # -------------------------------------------- # 03/10/19 th...@st... 1.38 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/21 th...@st... 1.13.1.32 # Fix eternal loop when calling btdamagemech() with a 'clustersize' of 0. # -------------------------------------------- # 03/10/31 th...@st... 1.13.1.33 # Glitchfix. # -------------------------------------------- # 03/10/31 th...@st... 1.13.1.34 # Possibly fix memory corruption problems 3030 has been having, by fixing around tprintf (as suggested by Null @ 3029.) # -------------------------------------------- # 03/11/14 th...@ce... 1.13.4.1 # Fix buglet in btlostohex(): use proper range. # -------------------------------------------- # 03/11/15 th...@st... 1.13.1.35 # Fix possibly malicious crashing bug in macros. # -------------------------------------------- # 03/11/15 th...@st... 1.39 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/11/15 th...@ce... 1.13.1.36 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/11/15 th...@st... 1.40 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/11/20 th...@st... 1.13.1.37 # Misc cleanup fixes. Stuff that probably didn't cause any real-world bugs, but should be fixed anyway. # -------------------------------------------- # 03/11/23 th...@st... 1.13.1.38 # - Facilitate debugging by not closing stdin/stdout. Old behaviour can be had by defining CLOSE_STDIN somewhere, but I have no use for it yet. # - Zap rediculous 'filedecriptor caching' that just re-used fd0 for everything, brutally closing it if needed. I'm suprised this hasn't caused odd bugs where data went to the wrong file. Totally unnecessary. # - Various memory buglets found by Valgrind. Some things were obviously wrong but never went wrong thanks to the reliability of stack layout in GCC. Others were potentially wrong but probably never did any harm -- but I could be wrong. # # -------------------------------------------- # 04/02/02 th...@st... 1.41 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 04/02/09 th...@st... 1.13.1.39 # Fix off-by-one error in reading maps with an X size of MAPX (1000 by default.) # -------------------------------------------- # 04/02/10 th...@st... 1.13.1.40 # Open help/news files for reading, not writing. Oopsie from last changeset. # -------------------------------------------- # 04/02/12 th...@st... 1.42 # Merge conflicts. # -------------------------------------------- # 04/02/12 th...@st... 1.13.1.41 # remove unused file. # -------------------------------------------- # 04/02/12 th...@st... 1.43 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bt-stable-test # into stalker.xs4all.nl:/home/thomas/btsrc/bt-dev-test # -------------------------------------------- # 04/02/13 th...@st... 1.44 # Undo previous change that deletes map.build.functions.c. # -------------------------------------------- # 04/03/05 th...@ce... 1.13.5.1 # foobar changeset # -------------------------------------------- # 04/03/05 th...@ce... 1.13.5.2 # foobar2 # -------------------------------------------- # 04/05/08 th...@st... 1.13.1.42 # Properly display valid/invalid LZ's in 'tactical b' even when not using colours. Previously, the characters \240 and \241 (inverted exclamation mark and non-break space, respectively, in ISO 8859-1 and -15) were displayed. # # -------------------------------------------- # 04/05/08 th...@st... 1.13.1.43 # Protect some xcodevalues from being changed, to avoid memory corruption and the like. # -------------------------------------------- # 04/05/09 th...@st... 1.45 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 04/05/09 th...@st... 1.46 # SF patch #920275: Fixes a bug in mech.combat.c:FireWeapon(), from Martin Murray. # Fixes a crashing bug when firing on hexes. # -------------------------------------------- # 04/05/09 th...@st... 1.13.1.44 # Fix some buglets in previous fixes: don't close fd's that weren't opened, and when using memmove instead of strcpy, include the terminating NUL manually. # -------------------------------------------- # 04/05/09 th...@st... 1.47 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 04/05/09 th...@st... 1.13.1.45 # Fix typo in previous checkin, and compile before checking in. # -------------------------------------------- # 04/05/09 th...@st... 1.48 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 04/05/11 th...@ce... 1.13.1.46 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 04/05/11 th...@ce... 1.13.1.47 # Fix compiler warnings: # - Add a few missing include files # - Remove unused variables # -------------------------------------------- # 04/05/11 th...@ce... 1.13.1.48 # Fix small loophole where you could tell an out-of-LOS unit's approximate location by triangulating 'out of arc' messages. Always give the same 'out of los' message for mechID's that are not in LOS, even if the mechID's don't exist or if they are out of range or out of arc. # -------------------------------------------- # 04/05/11 th...@st... 1.13.1.49 # Fix off-by-one error in the kick-decision range check in autopilots. # -------------------------------------------- # 04/07/29 th...@st... 1.13.1.50 # Attempt to improve the dieroll's randomness somewhat. # -------------------------------------------- # 04/08/09 th...@st... 1.49 # manual merge of stable branch with devel branch. # # -------------------------------------------- # Index: aero.move.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/aero.move.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** aero.move.c 23 May 2003 23:10:52 -0000 1.7 --- aero.move.c 9 Aug 2004 00:31:13 -0000 1.8 *************** *** 219,222 **** --- 219,264 ---- } + enum { + NO_ERROR, INVALID_TERRAIN, UNEVEN_TERRAIN, BLOCKED_LZ + }; + + char *reasons[] = { + "Improper terrain", + "Uneven ground", + "Blocked landing zone" + }; + + static int improper_lz_status; + static int improper_lz_height; + + static void ImproperLZ_callback(MAP *map, int x, int y) + { + if (Elevation(map, x, y) != improper_lz_height) + improper_lz_status = 0; + else + improper_lz_status++; + } + + #define MechCheckLZ(m) ImproperLZ((m), MechX((m)), MechY((m))) + + int ImproperLZ(MECH * mech, int x, int y) + { + MAP * map = getMap(mech->mapindex); + + if (GetRTerrain(map, x, y) != GRASSLAND && + GetRTerrain(map, x, y) != ROAD) + return INVALID_TERRAIN; + + improper_lz_status = 0; + improper_lz_height = Elevation(map, x, y); + visit_neighbor_hexes(map, x, y, ImproperLZ_callback); + + if (improper_lz_status != 6) + return UNEVEN_TERRAIN; + if (is_blocked_lz(mech, map, x, y)) + return BLOCKED_LZ; + return NO_ERROR; + } + void aero_land(dbref player, void *data, char *buffer) { *************** *** 281,285 **** && t == BUILDING)), "You can't land on this type of terrain."); ! if (MechType(mech) != CLASS_VTOL && ImproperLZ(mech)) { mech_notify(mech, MECHALL, "This location is no good for landing!"); --- 323,327 ---- && t == BUILDING)), "You can't land on this type of terrain."); ! if (MechType(mech) != CLASS_VTOL && MechCheckLZ(mech)) { mech_notify(mech, MECHALL, "This location is no good for landing!"); *************** *** 607,649 **** } - enum { - NO_ERROR, INVALID_TERRAIN, UNEVEN_TERRAIN, BLOCKED_LZ - }; - - char *reasons[] = { - "Improper terrain", - "Uneven ground", - "Blocked landing zone" - }; - - static int improper_lz_status; - static int improper_lz_height; - - static void ImproperLZ_callback(MAP *map, int x, int y) - { - if (Elevation(map, x, y) != improper_lz_height) - improper_lz_status = 0; - else - improper_lz_status++; - } - - int ImproperLZ(MECH *mech) - { - MAP *map = getMap(mech->mapindex); - int x = MechX(mech), y = MechY(mech); - - if (GetRTerrain(map, x, y) != GRASSLAND && - GetRTerrain(map, x, y) != ROAD) - return INVALID_TERRAIN; - improper_lz_status = 0; - improper_lz_height = Elevation(map, x, y); - visit_neighbor_hexes(map, x, y, ImproperLZ_callback); - if (improper_lz_status != 6) - return UNEVEN_TERRAIN; - if (is_blocked_lz(mech, map, x, y)) - return BLOCKED_LZ; - return NO_ERROR; - } - static char *colorstr(int serious) { --- 649,652 ---- *************** *** 657,661 **** void DS_LandWarning(MECH * mech, int serious) { ! int ilz = ImproperLZ(mech); if (!ilz) --- 660,664 ---- void DS_LandWarning(MECH * mech, int serious) { ! int ilz = MechCheckLZ(mech); if (!ilz) *************** *** 671,687 **** void aero_checklz(dbref player, MECH * mech, char *buffer) { ! int ilz; cch(MECH_USUAL); ! DOCHECK(Landed(mech), ! "You are landed already.. it looks good, doesn't it?"); ! ilz = ImproperLZ(mech); DOCHECKMA(!ilz, ! tprintf("The hex (%d,%d) looks good enough for a landing.", ! MechX(mech), MechY(mech) ! )); ilz--; mech_notify(mech, MECHALL, tprintf("The hex (%d,%d) doesn't look good for landing: %s.", ! MechX(mech), MechY(mech), reasons[ilz])); } --- 674,711 ---- void aero_checklz(dbref player, MECH * mech, char *buffer) { ! int ilz, argc; ! char *args[3]; ! int x, y; cch(MECH_USUAL); ! ! argc = mech_parseattributes(buffer, args, 3); ! switch(argc) { ! case 2: ! x = atoi(args[0]); ! y = atoi(args[1]); ! if (!MechIsObservator(mech)) { ! float fx, fy; ! MapCoordToRealCoord(x, y, &fx, &fy); ! DOCHECK(FindHexRange(MechFX(mech), MechFY(mech), fx, fy) > ! MechTacRange(mech), "Out of range!"); ! } ! break; ! case 0: ! x = MechX(mech); ! y = MechY(mech); ! break; ! default: ! notify(player, "Invalid number of parameters!"); ! return; ! } ! ! ilz = ImproperLZ(mech, x, y); DOCHECKMA(!ilz, ! tprintf("The hex (%d,%d) looks good enough for a landing.", ! x, y)); ilz--; mech_notify(mech, MECHALL, tprintf("The hex (%d,%d) doesn't look good for landing: %s.", ! x, y, reasons[ilz])); } Index: autogun.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/autogun.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** autogun.c 30 Sep 2003 01:01:32 -0000 1.2 --- autogun.c 9 Aug 2004 00:31:13 -0000 1.3 *************** *** 177,181 **** if (t->mynum == MechTarget(mech)) locktarg_num = target_count; ! targets[target_count++] = t; if (MechType(mech) == CLASS_MECH && (targetrange[target_count] <= 1.0) && --- 177,181 ---- if (t->mynum == MechTarget(mech)) locktarg_num = target_count; ! targets[target_count] = t; if (MechType(mech) == CLASS_MECH && (targetrange[target_count] <= 1.0) && *************** *** 186,189 **** --- 186,190 ---- mech_kick(a->mynum, mech, tb); } + target_count++; } MechNumSeen(mech) = ttarget_count; Index: bsuit.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/bsuit.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** bsuit.c 3 Apr 2002 11:30:19 -0000 1.6 --- bsuit.c 9 Aug 2004 00:31:13 -0000 1.7 *************** *** 292,296 **** targetID[1] = args[0][1]; targetnum = FindTargetDBREFFromMapNumber(mech, targetID); ! DOCHECK1(targetnum <= 0, "That is not a valid target ID!"); t = getMech(targetnum); DOCHECK1(!(t), "Invalid default target!"); --- 292,296 ---- targetID[1] = args[0][1]; targetnum = FindTargetDBREFFromMapNumber(mech, targetID); ! DOCHECK1(targetnum <= 0, "Target is not in line of sight!"); t = getMech(targetnum); DOCHECK1(!(t), "Invalid default target!"); *************** *** 300,305 **** return 1; } ! DOCHECK1((range = ! FaMechRange(mech, t)) >= 1.0, "Target out of range!"); DOCHECK1(Jumping(t), "That target's unreachable right now!"); DOCHECK1(MechType(t) != CLASS_MECH, "That target is of invalid type."); --- 300,307 ---- return 1; } ! range = FaMechRange(mech, t); ! DOCHECK1(!InLineOfSight_NB(mech, t, MechX(t), MechY(t), range), ! "Target is not in line of sight!"); ! DOCHECK1(range >= 1.0, "Target out of range!"); DOCHECK1(Jumping(t), "That target's unreachable right now!"); DOCHECK1(MechType(t) != CLASS_MECH, "That target is of invalid type."); Index: crit.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/crit.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** crit.c 25 Jun 2002 20:41:47 -0000 1.7 --- crit.c 9 Aug 2004 00:31:13 -0000 1.8 *************** *** 1704,1711 **** int weapindx, damage, loop, destroycrit, weapon_slot; int temp; - int wWeapDestroyed = 0; - int wFirstCrit = 0; - int wMaxCrits; - int wAmmoSection, wAmmoCritSlot; char locname[30]; char msgbuf[MBUF_SIZE]; --- 1704,1707 ---- *************** *** 1714,1718 **** int tLocIsLeg = ((hitloc == LLEG || hitloc == RLEG) || ((hitloc == LARM || hitloc == RARM) && MechIsQuad(wounded))); - int firstCrit = 0; char partBuf[100]; --- 1710,1713 ---- Index: econ.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/econ.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** econ.c 3 Jan 2002 01:01:03 -0000 1.1.1.1 --- econ.c 9 Aug 2004 00:31:13 -0000 1.2 *************** *** 35,45 **** return; j++; ! if (*j) ! strcpy(entry, j + 1); ! else { if (entry == alku) ! strcpy(alku, ""); else ! strcpy(entry - 1, ""); } } --- 35,48 ---- return; j++; ! if (*j) { ! /* Move the remainder of the string, including the terminating NUL, ! but not including the separating comma */ ! j++; ! memmove(entry, j, strlen(j) + 1); ! } else { if (entry == alku) ! *alku = '\0'; else ! *(entry - 1) = '\0'; } } *************** *** 51,55 **** sprintf(to + strlen(to), ",[%s]", data); else ! sprintf(to + strlen(to), "[%s]", data); } --- 54,58 ---- sprintf(to + strlen(to), ",[%s]", data); else ! sprintf(to, "[%s]", data); } Index: hudinfo.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/hudinfo.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** hudinfo.c 21 May 2003 09:23:59 -0000 1.15 --- hudinfo.c 9 Aug 2004 00:31:13 -0000 1.16 *************** *** 266,270 **** { static char wstatus[12]; - int tempstat; if (PartIsBroken(mech, sect, crit)) --- 266,269 ---- *************** *** 518,522 **** { int i; - int spec; char firemodes[30] = ""; char ammomodes[20] = ""; --- 517,520 ---- *************** *** 1064,1070 **** { char response[LBUF_SIZE]; ! int sect, dummy; MECH *targ; - float range; targ = hud_scantarget(d, mech, msgclass, args); --- 1062,1067 ---- { char response[LBUF_SIZE]; ! int sect; MECH *targ; targ = hud_scantarget(d, mech, msgclass, args); Index: map.bits.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/map.bits.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** map.bits.c 3 Jan 2002 01:01:38 -0000 1.1.1.1 --- map.bits.c 9 Aug 2004 00:31:13 -0000 1.2 *************** *** 75,79 **** c = 0; if (foo[i]) { ! for (j = 0; j < xs; j++) if (foo[i][j]) c++; --- 75,79 ---- c = 0; if (foo[i]) { ! for (j = 0; j < realnum(xs); j++) if (foo[i][j]) c++; Index: map.conditions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/map.conditions.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** map.conditions.c 18 Jul 2002 18:46:45 -0000 1.5 --- map.conditions.c 9 Aug 2004 00:31:13 -0000 1.6 *************** *** 150,154 **** int critType; int nhs = 0; - int z; int tDoAutoFall = 0; int tNormalizeAllCrits = 0; --- 150,153 ---- Index: mech.advanced.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.advanced.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mech.advanced.c 30 Sep 2003 01:01:32 -0000 1.6 --- mech.advanced.c 9 Aug 2004 00:31:13 -0000 1.7 *************** *** 860,864 **** int needed = 2 * (1 + (MechSChargeCounter(mech)++)); int roll = PRoll(mech); ! int i, j, count = 0; int maxspeed, newmaxspeed = 0; int critType; --- 860,864 ---- int needed = 2 * (1 + (MechSChargeCounter(mech)++)); int roll = PRoll(mech); ! int j, count = 0; int maxspeed, newmaxspeed = 0; int critType; *************** *** 1763,1766 **** --- 1763,1770 ---- char * state; + if (!target_mech) { + SendError("Invalid target_mech in display_mechpref!"); + return "Unknown error; contact a Wizard."; + } if (((MechPrefs(target_mech) & info.bit) && (info.flags & MECHPREF_FLAG_INVERTED)) || *************** *** 1798,1801 **** --- 1802,1806 ---- ShowCoolMenu(player, c); KillCoolMenu(c); + target_mech = NULL; } else { int i; *************** *** 1817,1823 **** MechPrefs(mech) |= (info.bit); ! if (((MechPrefs(target_mech) & info.bit) && (info.flags & MECHPREF_FLAG_INVERTED)) || ! (!(MechPrefs(target_mech) & info.bit) && !(info.flags & MECHPREF_FLAG_INVERTED))) { if (info.flags & MECHPREF_FLAG_NEGATIVE) --- 1822,1828 ---- MechPrefs(mech) |= (info.bit); ! if (((MechPrefs(mech) & info.bit) && (info.flags & MECHPREF_FLAG_INVERTED)) || ! (!(MechPrefs(mech) & info.bit) && !(info.flags & MECHPREF_FLAG_INVERTED))) { if (info.flags & MECHPREF_FLAG_NEGATIVE) Index: mech.ammodump.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.ammodump.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mech.ammodump.c 11 Dec 2002 13:44:55 -0000 1.2 --- mech.ammodump.c 9 Aug 2004 00:31:13 -0000 1.3 *************** *** 349,354 **** } } - - wcAmmoItems++; } else { /* crit specific dump */ wSecIter = ((wEventData >> 16) & 0xFF) - 1; --- 349,352 ---- Index: mech.bth.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.bth.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mech.bth.c 18 Jul 2002 18:46:45 -0000 1.7 --- mech.bth.c 9 Aug 2004 00:31:13 -0000 1.8 *************** *** 625,629 **** float target_speed = 0.0; int returnValue = 0; - int i; float m = 1.0; MAP *map = FindObjectsData(target->mapindex); --- 625,628 ---- Index: mech.combat.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.combat.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mech.combat.c 30 Sep 2003 01:01:32 -0000 1.15 --- mech.combat.c 9 Aug 2004 00:31:13 -0000 1.16 *************** *** 480,488 **** "You do not have a default target set!"); - if (MechType(mech) != CLASS_BSUIT) { - ARCCHECK(mech, enemyX, enemyY, section, critical, - "Default target is not in your weapons arc!"); - } - if (MechTarget(mech) != -1) { tempMech = getMech(MechTarget(mech)); --- 480,483 ---- *************** *** 537,540 **** --- 532,541 ---- } } + + if (MechType(mech) != CLASS_BSUIT) { + ARCCHECK(mech, enemyX, enemyY, section, critical, + "Default target is not in your weapons arc!"); + } + break; case 2: *************** *** 543,547 **** targetID[1] = args[1][1]; target = FindTargetDBREFFromMapNumber(mech, targetID); ! DOCHECK0(target == -1, "That is not a valid target ID!"); tempMech = getMech(target); DOCHECK0(!tempMech, "Error in FireWeaponNumber routine!"); --- 544,548 ---- targetID[1] = args[1][1]; target = FindTargetDBREFFromMapNumber(mech, targetID); ! DOCHECK0(target == -1, "That target is not in your line of sight!"); tempMech = getMech(target); DOCHECK0(!tempMech, "Error in FireWeaponNumber routine!"); *************** *** 552,560 **** mapy = MechY(tempMech); - if (MechType(mech) != CLASS_BSUIT) { - ARCCHECK(mech, enemyX, enemyY, section, critical, - "That target is not in your weapons arc!"); - } - range = FindRange(MechFX(mech), MechFY(mech), MechFZ(mech), enemyX, --- 553,556 ---- *************** *** 564,567 **** --- 560,568 ---- range); DOCHECK0(!LOS, "That target is not in your line of sight!"); + + if (MechType(mech) != CLASS_BSUIT) { + ARCCHECK(mech, enemyX, enemyY, section, critical, + "That target is not in your weapons arc!"); + } break; case 3: *************** *** 688,692 **** (MechWeapons[weapindx].shortrange_water <= 0)), "This weapon may not be fired underwater."); ! DOCHECKMA((TargetUnderwater(target) && (MechWeapons[weapindx].shortrange_water <= 0)), "This weapon may not be fired at underwater targets."); --- 689,693 ---- (MechWeapons[weapindx].shortrange_water <= 0)), "This weapon may not be fired underwater."); ! DOCHECKMA(target && (TargetUnderwater(target) && (MechWeapons[weapindx].shortrange_water <= 0)), "This weapon may not be fired at underwater targets."); Index: mech.combat.misc.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.combat.misc.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mech.combat.misc.c 30 Sep 2003 01:01:32 -0000 1.8 --- mech.combat.misc.c 9 Aug 2004 00:31:13 -0000 1.9 *************** *** 148,152 **** return; ! for (i = 0; i < NUM_CRITICALS; i++) { cl = CritsInLoc(mech, i); for (j = 0; j < cl; j++) --- 148,152 ---- return; ! for (i = 0; i < NUM_SECTIONS; i++) { cl = CritsInLoc(mech, i); for (j = 0; j < cl; j++) Index: mech.consistency.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.consistency.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mech.consistency.c 6 Dec 2002 14:26:34 -0000 1.8 --- mech.consistency.c 9 Aug 2004 00:31:13 -0000 1.9 *************** *** 310,313 **** --- 310,315 ---- calc_ints(mech, &ints_c, &ints_tot); for (i = 0; i < NUM_SECTIONS; i++) { + if (!GetSectOInt(mech, i)) + continue; armor += MyGetSectOArmor(mech, i); armor += MyGetSectORArmor(mech, i); *************** *** 425,428 **** --- 427,432 ---- } for (i = 0; i < NUM_SECTIONS; i++) { + if (!(GetSectOInt(mech, i))) + continue; armor += MyGetSectOArmor(mech, i); armor += MyGetSectORArmor(mech, i); Index: mech.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mech.h 30 Sep 2003 01:01:33 -0000 1.15 --- mech.h 9 Aug 2004 00:31:13 -0000 1.16 *************** *** 1,3 **** --- 1,4 ---- + /* * $Id$ Index: mech.ice.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.ice.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mech.ice.c 8 Dec 2002 01:23:07 -0000 1.5 --- mech.ice.c 9 Aug 2004 00:31:13 -0000 1.6 *************** *** 33,55 **** if (!(Elevation(map, x, y))) return; ! for (i = 0; i < map->first_free; i++) ! if ((j = map->mechsOnMap[i]) > 0) ! if ((t = getMech(j))) { ! if (MechX(t) != x || MechY(t) != y) ! continue; ! MechTerrain(t) = WATER; ! if ((!isbridge && (MechZ(t) == 0) && ! (MechMove(t) != MOVE_HOVER)) || (isbridge && ! MechZ(t) == MechElev(t))) { ! MechLOSBroadcast(t, msg); ! MechFalls(t, MechElev(t) + isbridge, 0); ! if (MechType(t) == CLASS_VEH_GROUND) ! if (!Destroyed(t)) { ! mech_notify(t, MECHALL, ! "Water renders your vehicle inoperational."); ! Destroy(t); ! } ! } } } --- 33,59 ---- if (!(Elevation(map, x, y))) return; ! for (i = 0; i < map->first_free; i++) { ! j = map->mechsOnMap[i]; ! if (j < 0) ! continue; ! t = getMech(j); ! if (!t) ! continue; ! if (MechX(t) != x || MechY(t) != y) ! continue; ! MechTerrain(t) = WATER; ! if ((!isbridge && (MechZ(t) == 0) && (MechMove(t) != MOVE_HOVER)) || ! (isbridge && MechZ(t) == MechElev(t))) { ! MechLOSBroadcast(t, msg); ! MechFalls(t, MechElev(t) + isbridge, 0); ! if (MechType(t) == CLASS_VEH_GROUND && !Destroyed(t)) { ! mech_notify(t, MECHALL, ! "Water renders your vehicle inoperable."); ! MechLOSBroadcast(t, ! "fizzles and pops as water renders it inoperable."); ! Destroy(t); } + } + } } *************** *** 83,86 **** --- 87,97 ---- MechFalls(mech, MechElev(mech), 0); } + if (MechElev(mech) > 0 && MechType(mech) == CLASS_VEH_GROUND && + !Destroyed(mech)) { + mech_notify(mech, MECHALL, "Water renders your vehicle inoperable."); + MechLOSBroadcast(mech, + "fizzles and pops as water renders it inoperable."); + Destroy(mech); + } } *************** *** 91,95 **** MarkForLOSUpdate(mech); ! mech_notify(mech, MECHALL, "You break thru the ice on your way up!"); MechLOSBroadcast(mech, "breaks through the ice!"); breakIceAndSplashUnits(map, mech, MechX(mech), MechY(mech), --- 102,106 ---- MarkForLOSUpdate(mech); ! mech_notify(mech, MECHALL, "You break through the ice!"); MechLOSBroadcast(mech, "breaks through the ice!"); breakIceAndSplashUnits(map, mech, MechX(mech), MechY(mech), Index: mech.maps.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.maps.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mech.maps.c 11 Dec 2002 13:44:55 -0000 1.13 --- mech.maps.c 9 Aug 2004 00:31:13 -0000 1.14 *************** *** 31,34 **** --- 31,35 ---- #include "p.ds.bay.h" #include "p.bsuit.h" + #include "p.mech.utils.h" void mech_findcenter(dbref player, void *data, char *buffer) *************** *** 49,52 **** --- 50,93 ---- } + static int parse_tacargs(dbref player, MECH *mech, char ** args, int argc, + int maxrange, short * x, short * y) + { + int bearing; + float range, fx, fy; + MECH * tempMech; + MAP * map; + + switch (argc) { + case 2: + bearing = atoi(args[0]); + range = atof(args[1]); + DOCHECK0(!MechIsObservator(mech) && + abs((int) range) > maxrange, + "Those coordinates are out of sensor range!"); + FindXY(MechFX(mech), MechFY(mech), bearing, range, &fx, &fy); + RealCoordToMapCoord(x, y, fx, fy); + return 1; + case 1: + map = getMap(mech->mapindex); + tempMech = getMech(FindMechOnMap(map, args[0])); + DOCHECK0(!tempMech, "No such target."); + range = FlMechRange(mech_map, mech, tempMech); + DOCHECK0(!InLineOfSight(mech, tempMech, MechX(tempMech), + MechY(tempMech), range), "No such target."); + DOCHECK0(abs((int) range) > maxrange, + "Target is out of scanner range."); + *x = MechX(tempMech); + *y = MechY(tempMech); + return 1; + case 0: + *x = MechX(mech); + *y = MechY(mech); + return 1; + default: + notify(player, "Invalid number of parameters!"); + return 0; + } + } + const char *GetTerrainName_base(int t) { *************** *** 112,121 **** /* Player-customizable colors */ ! enum { SWATER_IDX, DWATER_IDX, BUILDING_IDX, ROAD_IDX, ROUGH_IDX, ! MOUNTAIN_IDX, FIRE_IDX, ICE_IDX, WALL_IDX, SNOW_IDX, SMOKE_IDX, LWOOD_IDX, HWOOD_IDX, UNKNOWN_IDX, CLIFF_IDX, SELF_IDX, FRIEND_IDX, ENEMY_IDX, DS_IDX, ! DEEPSNOW_IDX, MUD_IDX, SWAMP_IDX, RAPIDS_IDX, ELEVATION_IDX, ! NUM_COLOR_IDX }; --- 153,161 ---- /* Player-customizable colors */ ! enum { SWATER_IDX, DWATER_IDX, BUILDING_IDX, ROAD_IDX, ROUGH_IDX, MOUNTAIN_IDX, FIRE_IDX, ICE_IDX, WALL_IDX, SNOW_IDX, SMOKE_IDX, LWOOD_IDX, HWOOD_IDX, UNKNOWN_IDX, CLIFF_IDX, SELF_IDX, FRIEND_IDX, ENEMY_IDX, DS_IDX, ! GOODLZ_IDX, BADLZ_IDX, DEEPSNOW_IDX, MUD_IDX, SWAMP_IDX, RAPIDS_IDX, ! ELEVATION_IDX, NUM_COLOR_IDX }; *************** *** 124,129 **** /* internal rep has H instead of h and \0 instead of n */ ! #define DEFAULT_COLOR_STRING "BbWnYyRWWnXGgbRhYRnWYgnW" ! #define DEFAULT_COLOR_SCHEME "BbW\0YyRWW\0XGgbRHYR\0WYg\nW" static char custom_color_str[NUM_COLOR_IDX + 1] = DEFAULT_COLOR_SCHEME; --- 164,169 ---- /* internal rep has H instead of h and \0 instead of n */ ! #define DEFAULT_COLOR_STRING "BbWnYyRWWWXGgbRhYRnGRWYgnW" ! #define DEFAULT_COLOR_SCHEME "BbW\0YyRWWWXGgbRHYR\0GRWYg\nW" static char custom_color_str[NUM_COLOR_IDX + 1] = DEFAULT_COLOR_SCHEME; *************** *** 134,139 **** int i; ! if (*str && strlen(str) == NUM_COLOR_IDX) { ! strncpy(custom_color_str, str, NUM_COLOR_IDX); for (i = 0; i < NUM_COLOR_IDX; i++) { switch (custom_color_str[i]) { --- 174,180 ---- int i; ! if (*str && strlen(str) <= NUM_COLOR_IDX) { ! strncpy(custom_color_str, DEFAULT_COLOR_STRING, NUM_COLOR_IDX); ! strncpy(custom_color_str, str, strlen(str)); for (i = 0; i < NUM_COLOR_IDX; i++) { switch (custom_color_str[i]) { *************** *** 190,195 **** char mybuff[NAVIGATE_LINES][MBUF_SIZE]; MAP *mech_map; ! char **maptext; ! int i, dolos; cch(MECH_USUAL); --- 231,237 ---- char mybuff[NAVIGATE_LINES][MBUF_SIZE]; MAP *mech_map; ! char **maptext, *args[3]; ! int i, dolos, argc; ! short x, y; cch(MECH_USUAL); *************** *** 200,216 **** mudconf.btech_mw_losmap); ! if (mech_map->map_width > 0 && mech_map->map_height > 0) { ! set_colorscheme(player); ! maptext = MakeMapText(player, mech, mech_map, MechX(mech), ! MechY(mech), 5, 5, 4, dolos); ! } else { ! static char dummy[] = ""; ! static char *dummy2[12] = ! { dummy, dummy, dummy, dummy, dummy, dummy, ! dummy, dummy, dummy, dummy, dummy, NULL ! }; ! maptext = dummy2; ! } sprintf(mybuff[0], --- 242,254 ---- mudconf.btech_mw_losmap); ! DOCHECK(mech_map->map_width <= 0 || mech_map->map_height <= 0, ! "Nothing to see on this map, move along."); ! argc = mech_parseattributes(buffer, args, 3); ! if (!parse_tacargs(player, mech, args, argc, MechTacRange(mech), &x, &y)) ! return; ! ! set_colorscheme(player); ! maptext = MakeMapText(player, mech, mech_map, x, y, 5, 5, 4, dolos); sprintf(mybuff[0], *************** *** 251,255 **** sprintf(mybuff[12], " 180"); ! navigate_sketch_mechs(mech, mech_map, MechX(mech), MechY(mech), mybuff); for (i = 0; i < NAVIGATE_LINES; i++) notify(player, mybuff[i]); --- 289,293 ---- sprintf(mybuff[12], " 180"); ! navigate_sketch_mechs(mech, mech_map, x, y, mybuff); for (i = 0; i < NAVIGATE_LINES; i++) notify(player, mybuff[i]); *************** *** 445,450 **** char c = GetHexTerrain(map, x, y); ! int e = GetHexElevation(map, x, y); ! char newc = TerrainColorChar(c, e); if (!c || !docolor || c == ' ') { --- 483,487 ---- char c = GetHexTerrain(map, x, y); ! char newc; if (!c || !docolor || c == ' ') { *************** *** 452,456 **** buf[1] = '\0'; return buf; ! } return add_color(newc, prevc, c); --- 489,512 ---- buf[1] = '\0'; return buf; ! } else ! newc = TerrainColorChar(c, GetHexElevation(map, x, y)); ! ! return add_color(newc, prevc, c); ! } ! ! static char *LRSElevation(MAP * map, int x, int y, int docolor, char *prevc) ! { ! static char buf[2]; /* Won't be filled with more than 1 character */ ! ! int e = GetHexElevation(map, x, y); ! char c = (e || docolor) ? '0' + e : ' '; ! char newc; ! ! if (!docolor) { ! buf[0] = c; ! buf[1] = '\0'; ! return buf; ! } else ! newc = TerrainColorChar(GetHexTerrain(map, x, y), e); return add_color(newc, prevc, c); *************** *** 462,465 **** --- 518,522 ---- #define LRS_LOSMODE 8 #define LRS_COLORMODE 16 + #define LRS_ELEVCOLORMODE 32 static char *get_lrshexstr(MECH * mech, MAP * map, int x, int y, *************** *** 467,472 **** { int losflag = MAPLOSHEX_SEE | MAPLOSHEX_SEEN; - char c; - static char buf[5]; if (mode & LRS_MECHMODE) { --- 524,527 ---- *************** *** 493,507 **** return add_color(TerrainColorChar(UNKNOWN_TERRAIN, 0), prevc, '?'); ! if (mode & LRS_ELEVMODE) { ! c = GetHexElevation(map, x, y) + '0'; ! if (c == '0') ! c = ' '; ! if (*prevc) { ! sprintf(buf, "%%cn%c", c); ! *prevc = '\0'; ! } else ! sprintf(buf, "%c", c); ! return buf; ! } if (mode & LRS_TERRAINMODE) return LRSTerrain(map, x, y, mode & LRS_COLORMODE, prevc); --- 548,553 ---- return add_color(TerrainColorChar(UNKNOWN_TERRAIN, 0), prevc, '?'); ! if (mode & LRS_ELEVMODE) ! return LRSElevation(map, x, y, mode & LRS_ELEVCOLORMODE, prevc); if (mode & LRS_TERRAINMODE) return LRSTerrain(map, x, y, mode & LRS_COLORMODE, prevc); *************** *** 635,639 **** } ! if (mode & LRS_COLORMODE) { if (prevct) { strcat(topbuff, "%cn"); --- 681,685 ---- } ! if (mode & (LRS_COLORMODE|LRS_ELEVCOLORMODE)) { if (prevct) { strcat(topbuff, "%cn"); *************** *** 654,663 **** { MECH *mech = (MECH *) data; - MECH *tempMech; MAP *map; ! int argc, bearing, mode = 0; short x, y; char *args[5], *str; - float fx, fy, range; int displayHeight = LRS_DISPLAY_HEIGHT; --- 700,707 ---- { MECH *mech = (MECH *) data; MAP *map; ! int argc, mode = 0; short x, y; char *args[5], *str; int displayHeight = LRS_DISPLAY_HEIGHT; *************** *** 671,704 **** argc = mech_parseattributes(buffer, args, 4); DOCHECK(!MechLRSRange(mech), "Your system seems to be inoperational."); ! switch (argc) { ! case 3: ! bearing = atoi(args[1]); ! range = atof(args[2]); ! DOCHECK(!MechIsObservator(mech) && ! abs((int) range) > MechLRSRange(mech), ! "Those coordinates are out of sensor range!"); ! FindXY(MechFX(mech), MechFY(mech), bearing, range, &fx, &fy); ! RealCoordToMapCoord(&x, &y, fx, fy); ! break; ! case 2: ! tempMech = getMech(FindTargetDBREFFromMapNumber(mech, args[1])); ! DOCHECK(!tempMech, "No such target."); ! range = FlMechRange(map, mech, tempMech); ! DOCHECK(!InLineOfSight(mech, tempMech, MechX(tempMech), ! MechY(tempMech), range), "No such target."); ! DOCHECK(abs((int) range) > MechLRSRange(mech), ! "Target is out of scanner range."); ! x = MechX(tempMech); ! y = MechY(tempMech); ! break; ! case 1: ! x = MechX(mech); ! y = MechY(mech); ! break; ! default: ! notify(player, "Invalid number of parameters!"); return; - } - switch (args[0][0]) { case 'M': --- 715,721 ---- argc = mech_parseattributes(buffer, args, 4); DOCHECK(!MechLRSRange(mech), "Your system seems to be inoperational."); ! if (!parse_tacargs(player, mech, &args[1], argc - 1, ! MechLRSRange(mech), &x, &y)) return; switch (args[0][0]) { case 'M': *************** *** 710,713 **** --- 727,734 ---- mode |= LRS_ELEVMODE; break; + case 'C': + case 'c': + mode |= LRS_ELEVMODE | LRS_ELEVCOLORMODE; + break; case 'T': case 't': *************** *** 1104,1107 **** --- 1125,1153 ---- } } + static void sketch_tac_dslz(char *buf, MAP * map, MECH * mech, int sx, + int sy, int wx, int wy, int dispcols, + int top_offset, int left_offset, int cliff_size, + int docolour) + { + char *pos = buf + top_offset * dispcols + left_offset; + int y, x; + int oddcol1 = is_oddcol(sx); + + wx = MIN(wx, map->map_width - sx); + wy = MIN(wy, map->map_height - sy); + for (y = MAX(0, -sy); y < wy; y++) { + int ty = sy + y; + + for (x = MAX(0, -sx); x < wx; x++) { + int tx = sx + x; + char *base = pos + tac_hex_offset(x, y, dispcols, oddcol1); + + if (ImproperLZ(mech, tx, ty)) + base[dispcols] = docolour ? '\241' : 'X'; + else + base[dispcols] = docolour ? '\240' : 'O'; + } + } + } /* *************** *** 1165,1168 **** --- 1211,1222 ---- break; + case (unsigned char) '\241': /* Colour Hack: improper LZ */ + c = 'X'; + new_colour = custom_color_str[BADLZ_IDX]; + break; + case (unsigned char) '\240': /* Colour Hack: proper LZ */ + c = 'O'; + new_colour = custom_color_str[GOODLZ_IDX]; + break; case '?': c = '?'; *************** *** 1292,1295 **** --- 1346,1350 ---- * 8 = show mech cliffs * 16 = show tank cliffs + * 32 = show DS LZ's * * If navigate mode, wx and wy should be equal and odd. Navigate maps *************** *** 1433,1436 **** --- 1488,1498 ---- sketch_tac_cliffs(sketch_buf, map, sx, sy, wx, wy, dispcols, top_offset, left_offset, 2); + } else if (labels & 32) { + if (mech != NULL) { + sketch_tac_ownmech(sketch_buf, map, mech, sx, sy, wx, wy, + dispcols, top_offset, left_offset); + } + sketch_tac_dslz(sketch_buf, map, mech, sx, sy, wx, wy, dispcols, + top_offset, left_offset, 2, docolour); } else if (mech != NULL) { sketch_tac_mechs(sketch_buf, map, mech, sx, sy, wx, wy, dispcols, *************** *** 1502,1513 **** short x, y; int mapx, mapy; - MECH *tempMech; char *args_vec[4]; char **args = args_vec; MAP *mech_map; - float fx, fy; - float range; - int bearing; - int target; int displayHeight; char *str; --- 1564,1570 ---- *************** *** 1541,1544 **** --- 1598,1605 ---- break; + case 'b': + flags |= 32; + break; + default: notify(player, "Invalid tactical map flag."); *************** *** 1549,1584 **** } ! DOCHECK(dohexlos && (flags & (8|16)), "You can't see cliffs here!"); ! switch (argc) { ! case 2: ! bearing = atoi(args[0]); ! range = atof(args[1]); ! DOCHECK(!MechIsObservator(mech) && ! abs((int) range) > MechTacRange(mech), ! "Those coordinates are out of sensor range!"); ! FindXY(MechFX(mech), MechFY(mech), bearing, range, &fx, &fy); ! RealCoordToMapCoord(&x, &y, fx, fy); ! break; ! case 1: ! target = FindTargetDBREFFromMapNumber(mech, args[0]); ! tempMech = getMech(target); ! DOCHECK(!tempMech, "No such target."); ! range = FlMechRange(mech_map, mech, tempMech); ! DOCHECK(!InLineOfSight(mech, tempMech, MechX(tempMech), ! MechY(tempMech), range), "No such target."); ! DOCHECK(abs((int) range) > MechTacRange(mech), ! "Target is out of scanner range."); ! x = MechX(tempMech); ! y = MechY(tempMech); ! break; ! case 0: ! x = MechX(mech); ! y = MechY(mech); ! break; ! default: ! notify(player, "Invalid number of parameters!"); return; ! } str = silly_atr_get(player, A_TACHEIGHT); if (!*str) --- 1610,1618 ---- } ! DOCHECK(dohexlos && (flags & (8|16|32)), "You can't see that much here!"); ! if (!parse_tacargs(player, mech, args, argc, MechTacRange(mech), &x, &y)) return; ! str = silly_atr_get(player, A_TACHEIGHT); if (!*str) Index: mech.move.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.move.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mech.move.c 30 Sep 2003 01:01:33 -0000 1.12 --- mech.move.c 9 Aug 2004 00:31:13 -0000 1.13 *************** *** 490,493 **** --- 490,496 ---- MechLOSBroadcast(mech, "attempts to stand up."); + if (MechRTerrain(mech) == ICE && MechZ(mech) == -1) + break_thru_ice(mech); + if (tNeedsPSkill) { if (!MadePilotSkillRoll(mech, 0)) { *************** *** 887,891 **** int limbs = 4; int aLimbs[] = { RARM, LARM, LLEG, RLEG }; ! int i, j; int tempLoc; char locName[50]; --- 890,894 ---- int limbs = 4; int aLimbs[] = { RARM, LARM, LLEG, RLEG }; ! int i; int tempLoc; char locName[50]; *************** *** 954,958 **** continue; ! if (Jumping(target)) continue; --- 957,961 ---- continue; ! if (Jumping(target) || OODing(target)) continue; *************** *** 1639,1643 **** if (MechType(mech) != CLASS_MECH) continue; ! if (Jumping(mech)) continue; if (friendly < 0 || ((MechTeam(mech) == team) == friendly)) --- 1642,1646 ---- if (MechType(mech) != CLASS_MECH) continue; ! if (Jumping(mech) || OODing(mech)) continue; if (friendly < 0 || ((MechTeam(mech) == team) == friendly)) *************** *** 1706,1710 **** if (MechType(mech) != CLASS_MECH) continue; ! if (Jumping(mech)) continue; if (friendly < 0 || ((MechTeam(mech) == team) == friendly)) --- 1709,1713 ---- if (MechType(mech) != CLASS_MECH) continue; ! if (Jumping(mech) || OODing(mech)) continue; if (friendly < 0 || ((MechTeam(mech) == team) == friendly)) Index: mech.notify.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.notify.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mech.notify.c 30 Sep 2003 01:01:33 -0000 1.9 --- mech.notify.c 9 Aug 2004 00:31:13 -0000 1.10 *************** *** 515,519 **** /* 1234567890123456 */ ! const char tempc[] = "xrgybmcwXRGYBMCW"; static char *ccode(MECH * m, int i) --- 515,519 ---- /* 1234567890123456 */ ! const char radio_colorstr[] = "xrgybmcwXRGYBMCW"; static char *ccode(MECH * m, int i) *************** *** 527,534 **** }; if (t < 9) { ! sprintf(buf, "%%c%c", tempc[t - 1]); return buf; } ! sprintf(buf, "%%ch%%c%c", ToLower(tempc[t - 1])); return buf; } --- 527,534 ---- }; if (t < 9) { ! sprintf(buf, "%%c%c", radio_colorstr[t - 1]); return buf; } ! sprintf(buf, "%%ch%%c%c", ToLower(radio_colorstr[t - 1])); return buf; } *************** *** 588,597 **** break; default: ! for (i = 0; tempc[i]; i++) ! if (*buffer == tempc[i]) { nm = nm % FREQ_REST + FREQ_REST * (i + 1); break; } ! if (!tempc[i]) buffer = NULL; break; --- 588,597 ---- break; default: ! for (i = 0; radio_colorstr[i]; i++) ! if (*buffer == radio_colorstr[i]) { nm = nm % FREQ_REST + FREQ_REST * (i + 1); break; } ! if (!radio_colorstr[i]) buffer = NULL; break; *************** *** 620,624 **** buf[i++] = '-'; if (nm / FREQ_REST) { ! sprintf(buf + i, "/color:%c", tempc[nm / FREQ_REST - 1]); i = strlen(buf); } --- 620,624 ---- buf[i++] = '-'; if (nm / FREQ_REST) { ! sprintf(buf + i, "/color:%c", radio_colorstr[nm / FREQ_REST - 1]); i = strlen(buf); } *************** *** 641,647 **** mech->freqmodes[i] & FREQ_MUTE ? 'M' : '-', mech->freqmodes[i] & FREQ_SCAN ? 'S' : mech-> ! freqmodes[i] >= ! FREQ_REST ? tempc[mech->freqmodes[i] / FREQ_REST - ! 1] : mech->freqmodes[i] & FREQ_INFO ? 'I' : '-', mech->freq[i], mech->chantitle[i])); } --- 641,647 ---- mech->freqmodes[i] & FREQ_MUTE ? 'M' : '-', mech->freqmodes[i] & FREQ_SCAN ? 'S' : mech-> ! freqmodes[i] >= FREQ_REST ? ! radio_colorstr[mech->freqmodes[i] / FREQ_REST - 1] : ! mech->freqmodes[i] & FREQ_INFO ? 'I' : '-', mech->freq[i], mech->chantitle[i])); } Index: mech.physical.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.physical.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mech.physical.c 30 Sep 2003 01:01:33 -0000 1.9 --- mech.physical.c 9 Aug 2004 00:31:13 -0000 1.10 *************** *** 459,464 **** targetID[1] = args[0][1]; targetnum = FindTargetDBREFFromMapNumber(mech, targetID); ! DOCHECKMA(targetnum == -1, "That is not a valid target ID!"); target = getMech(targetnum); if (!target) { mech_notify(mech, MECHALL, "Invalid target data!"); --- 459,468 ---- targetID[1] = args[0][1]; targetnum = FindTargetDBREFFromMapNumber(mech, targetID); ! DOCHECKMA(targetnum == -1, "Target is not in line of sight!"); target = getMech(targetnum); + DOCHECKMA(!InLineOfSight_NB(mech, target, MechX(target), + MechY(target), FaMechRange(mech, target)), + "Target is not in line of sight!"); + if (!target) { mech_notify(mech, MECHALL, "Invalid target data!"); *************** *** 587,591 **** { MECH *target; ! float range = 0.0; float maxRange = 1; char targetID[2]; --- 591,595 ---- { MECH *target; ! float range; float maxRange = 1; char targetID[2]; *************** *** 691,700 **** (MechType(target) != CLASS_VEH_GROUND), "You can only punch vehicles while you're fallen"); ! DOCHECKMA((FaMechRange(mech, target)) >= maxRange, ! "Target out of range!"); ! DOCHECKMA(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), range), "You are unable to hit that target at the moment."); break; default: --- 695,705 ---- (MechType(target) != CLASS_VEH_GROUND), "You can only punch vehicles while you're fallen"); ! range = FaMechRange(mech, target); DOCHECKMA(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), range), "You are unable to hit that target at the moment."); + + DOCHECKMA(range >= maxRange, "Target out of range!"); + break; default: *************** *** 703,707 **** targetID[1] = args[0][1]; targetnum = FindTargetDBREFFromMapNumber(mech, targetID); ! DOCHECKMA(targetnum == -1, "That is not a valid target ID!"); target = getMech(targetnum); DOCHECKMA(!target, "Invalid default target!"); --- 708,712 ---- targetID[1] = args[0][1]; targetnum = FindTargetDBREFFromMapNumber(mech, targetID); ! DOCHECKMA(targetnum == -1, "Target is not in line of sight!"); target = getMech(targetnum); DOCHECKMA(!target, "Invalid default target!"); *************** *** 711,720 **** maxRange = 0.5; ! DOCHECKMA((FaMechRange(mech, target)) >= maxRange, ! "Target out of range!"); DOCHECKMA(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), range), ! "You are unable to hit that target at the moment."); } --- 716,727 ---- maxRange = 0.5; ! range = FaMechRange(mech, target); DOCHECKMA(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), range), ! "Target is not in line of sight!"); ! ! DOCHECKMA(range >= maxRange, ! "Target out of range!"); } Index: mech.pickup.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.pickup.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mech.pickup.c 14 Sep 2003 20:14:35 -0000 1.6 --- mech.pickup.c 9 Aug 2004 00:31:13 -0000 1.7 *************** *** 27,30 **** --- 27,31 ---- #include "p.mech.tag.h" #include "p.bsuit.h" + #include "p.mech.ice.h" void mech_pickup(dbref player, void *data, char *buffer) *************** *** 34,38 **** dbref target_num; MAP *newmap; ! int argc; char *args[4]; --- 35,39 ---- dbref target_num; MAP *newmap; ! int argc, through_ice; char *args[4]; *************** *** 129,132 **** --- 130,142 ---- StopBogDownWaiting(mech); + through_ice = (MechRTerrain(target) == ICE && MechZ(mech) >= 0 && + MechZ(target) < 0); + MirrorPosition(mech, target, 0); + if (through_ice) { + if (MechZ(mech) == 0 && MechMove(mech) != MOVE_HOVER) + drop_thru_ice(mech); + else + break_thru_ice(mech); + } if (!Destroyed(target)) Shutdown(target); *************** *** 278,282 **** MAP *newmap; dbref aRef; - int x, y; int argc; char *args[2]; --- 288,291 ---- Index: mech.scan.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.scan.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mech.scan.c 8 Dec 2002 01:23:07 -0000 1.5 --- mech.scan.c 9 Aug 2004 00:31:13 -0000 1.6 *************** *** 764,768 **** targetnum = FindTargetDBREFFromMapNumber(mech, targetID); if (targetnum == -1) { ! mech_notify(mech, MECHPILOT, "That is not a valid target ID!"); return; } --- 764,768 ---- targetnum = FindTargetDBREFFromMapNumber(mech, targetID); if (targetnum == -1) { ! mech_notify(mech, MECHPILOT, "Target is not in line of sight!"); return; } *************** *** 772,776 **** !InLineOfSight(mech, target, MechX(target), MechY(target), FlMechRange(mech_map, mech, target))) { ! mech_notify(mech, MECHPILOT, "That is not a valid target ID!"); return; } --- 772,776 ---- !InLineOfSight(mech, target, MechX(target), MechY(target), FlMechRange(mech_map, mech, target))) { ! mech_notify(mech, MECHPILOT, "Target is not in line of sight!"); return; } Index: mech.update.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.update.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mech.update.c 30 Sep 2003 01:01:33 -0000 1.13 --- mech.update.c 9 Aug 2004 00:31:14 -0000 1.14 *************** *** 144,147 **** --- 144,148 ---- case HIT_UNDER_BRIDGE: /* Hovers only... tho it should be fixed for foils and hulls too */ if ((lt == BRIDGE) && (MechRTerrain(m... [truncated message content] |