btech-checkins Mailing List for Battletech MUX
Brought to you by:
twouters
You can subscribe to this list here.
2002 |
Jan
(205) |
Feb
(70) |
Mar
(27) |
Apr
(17) |
May
(1) |
Jun
(43) |
Jul
(109) |
Aug
(11) |
Sep
|
Oct
(1) |
Nov
(37) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
(3) |
Jun
(28) |
Jul
|
Aug
|
Sep
(26) |
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: SourceForge.net <no...@so...> - 2005-10-20 20:10:57
|
Patches item #1333550, was opened at 2005-10-20 23:10 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=435200&aid=1333550&group_id=43080 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tuncay Goncuoglu (tgoncuoglu) Assigned to: Nobody/Anonymous (nobody) Summary: Walk Back Initial Comment: Makes a piloting roll if pilot attempts to walk backwards over a higher elevation. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=435200&aid=1333550&group_id=43080 |
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] |
From: Thomas W. <two...@us...> - 2004-08-09 00:31:56
|
Update of /cvsroot/btech/btechmux/src/hcode/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19526/src/hcode/include Modified Files: glue.h macros.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: glue.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/include/glue.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** glue.h 30 Sep 2003 01:01:34 -0000 1.8 --- glue.h 9 Aug 2004 00:31:16 -0000 1.9 *************** *** 376,381 **** mech_range}, {0, ! "LRS <M|T|E|L|S|H> [<BEARING> <RANGE> | <TARGET-ID>]", ! "Shows the long range map", mech_lrsmap}, {0, "TACTICAL [C | T | L] [<BEARING> <RANGE> | <TARGET-ID>]", "Shows the tactical map at the mech's location / at bearing and range / around chosen target", --- 376,381 ---- mech_range}, {0, ! "LRS <M|T|E|L|S|H|C> [<BEARING> <RANGE> | <TARGET-ID>]", ! "Shows the (Mech/Terrain/Elevation/LOS/Sensors/Height/Combined) long range map", mech_lrsmap}, {0, "TACTICAL [C | T | L] [<BEARING> <RANGE> | <TARGET-ID>]", "Shows the tactical map at the mech's location / at bearing and range / around chosen target", Index: macros.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/include/macros.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** macros.h 3 Jan 2002 01:01:39 -0000 1.1.1.1 --- macros.h 9 Aug 2004 00:31:16 -0000 1.2 *************** *** 51,56 **** /* Dice-rolling function used everywhere converted to a macro */ ! #define Number(a,b) ((a) + random()%((b)-(a)+1)) ! #define skipws(name) while (name && *name && isspace(*name)) name++ --- 51,63 ---- /* Dice-rolling function used everywhere converted to a macro */ ! /* Shift the random number to get rid of the usually not-very-random ! lower order bits. Because Number() is used with a wide range of numbers, ! as high as 5000 at least, we do a little dance to determine the amount ! to shift */ ! #define Number(a,b) ((a) + (random() >> ( \ ! ((b) - (a)) > 16777216 ? 0 : \ ! ((b) - (a)) > 65536 ? 8 : \ ! ((b) - (a)) > 4096 ? 16 : 20 \ ! )) % ((b)-(a)+1)) #define skipws(name) while (name && *name && isspace(*name)) name++ |
From: Thomas W. <two...@us...> - 2004-08-09 00:31:54
|
Update of /cvsroot/btech/btechmux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19526/src Modified Files: bsd.c comsys.c db.c db.h eval.c file_c.c functions.c game.c help.c macro.c mail.c p.db.h p.sa-db.h predicates.c wiz.c 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: bsd.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/bsd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bsd.c 23 Jan 2002 21:20:24 -0000 1.3 --- bsd.c 9 Aug 2004 00:31:08 -0000 1.4 *************** *** 1213,1217 **** #ifdef HAVE_UNION_WAIT ! union wait stat; #else --- 1213,1217 ---- #ifdef HAVE_UNION_WAIT ! union wait stat = {0}; #else Index: comsys.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/comsys.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** comsys.c 8 Dec 2002 01:23:06 -0000 1.12 --- comsys.c 9 Aug 2004 00:31:08 -0000 1.13 *************** *** 1745,1749 **** { struct channel *ch; - struct comuser *user; static char smbuf[SBUF_SIZE]; --- 1745,1748 ---- Index: db.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/db.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db.c 23 Jan 2002 21:20:24 -0000 1.4 --- db.c 9 Aug 2004 00:31:08 -0000 1.5 *************** *** 91,242 **** /* - * --------------------------------------------------------------------------- - * * Temp file management, used to get around static limits in some versions - * * of libc. - */ - - FILE *t_fd; - int t_is_pipe; - - #ifdef TLI - int t_is_tli; - - #endif - - static void tf_xclose(fd) - FILE *fd; - { - if (fd) { - if (t_is_pipe) - pclose(fd); - #ifdef TLI - else if (t_is_tli) - t_close(fd); - #endif - else - fclose(fd); - } else { - close(0); - } - t_fd = NULL; - t_is_pipe = 0; - } - - static int tf_fiddle(tfd) - int tfd; - { - if (tfd < 0) { - tfd = open(DEV_NULL, O_RDONLY, 0); - return -1; - } - if (tfd != 0) { - dup2(tfd, 0); - close(tfd); - } - return 0; - } - - static int tf_xopen(fname, mode) - char *fname; - int mode; - { - int fd; - - fd = open(fname, mode, 0600); - fd = tf_fiddle(fd); - return fd; - } - - /* - * #define t_xopen(f,m) t_fiddle(open(f, m, 0600)) - */ - - static const char *mode_txt(mode) - int mode; - { - switch (mode & O_ACCMODE) { - case O_RDONLY: - return "r"; - case O_WRONLY: - return "w"; - } - return "r+"; - } - - void NDECL(tf_init) - { - fclose(stdin); - tf_xopen(DEV_NULL, O_RDONLY); - t_fd = NULL; - t_is_pipe = 0; - } - - int tf_open(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - return tf_xopen(fname, mode); - } - - #ifndef STANDALONE - - int tf_socket(fam, typ) - int fam, typ; - { - tf_xclose(t_fd); - return tf_fiddle(socket(fam, typ, 0)); - } - - #ifdef TLI - int tf_topen(fam, mode) - int fam, mode; - { - tf_xclose(t_fd); - return tf_fiddle(t_open(fam, mode, NULL)); - } - - #endif - #endif - - void tf_close(fdes) - int fdes; - { - tf_xclose(t_fd); - tf_xopen(DEV_NULL, O_RDONLY); - } - - FILE *tf_fopen(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - if (tf_xopen(fname, mode) >= 0) { - t_fd = fdopen(0, mode_txt(mode)); - return t_fd; - } - return NULL; - } - - void tf_fclose(fd) - FILE *fd; - { - tf_xclose(t_fd); - tf_xopen(DEV_NULL, O_RDONLY); - } - - FILE *tf_popen(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - t_fd = popen(fname, mode_txt(mode)); - if (t_fd != NULL) { - t_is_pipe = 1; - } - return t_fd; - } - - /* * #define GNU_MALLOC_TEST 1 */ --- 91,94 ---- *************** *** 2715,2718 **** --- 2567,2572 ---- s_Owner(thing, GOD); s_Flags(thing, (TYPE_GARBAGE | GOING)); + s_Flags2(thing, 0); + s_Flags3(thing, 0); s_Powers(thing, 0); s_Powers2(thing, 0); Index: db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/db.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** db.h 3 Jan 2002 00:59:28 -0000 1.1.1.1 --- db.h 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 231,244 **** extern void FDECL(s_Pennies, (dbref, int)); - extern void NDECL(tf_init); - extern int FDECL(tf_open, (char *, int)); - extern int FDECL(tf_socket, (int, int)); - extern void FDECL(tf_close, (int)); - extern FILE *FDECL(tf_fopen, (char *, int)); - extern void FDECL(tf_fclose, (FILE *)); - extern FILE *FDECL(tf_popen, (char *, int)); - - #define tf_pclose(f) tf_fclose(f) - extern dbref FDECL(getref, (FILE *)); extern void FDECL(putref, (FILE *, dbref)); --- 231,234 ---- Index: eval.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/eval.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eval.c 31 Jul 2002 14:53:04 -0000 1.3 --- eval.c 9 Aug 2004 00:31:08 -0000 1.4 *************** *** 183,187 **** break; case '[': ! if (cstr[-1] == ESC_CHAR) { first = 0; break; --- 183,187 ---- break; case '[': ! if (cstr != rstr && cstr[-1] == ESC_CHAR) { first = 0; break; Index: file_c.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/file_c.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** file_c.c 3 Jan 2002 00:59:54 -0000 1.1.1.1 --- file_c.c 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 136,140 **** */ ! if ((fd = tf_open(filename, O_RDONLY)) == -1) { /* --- 136,140 ---- */ ! if ((fd = open(filename, O_RDONLY)) == -1) { /* *************** *** 149,153 **** ENDLOG; } - tf_close(fd); return -1; --- 149,152 ---- *************** *** 189,193 **** } free_lbuf(buff); ! tf_close(fd); /* --- 188,192 ---- } free_lbuf(buff); ! close(fd); /* Index: functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/functions.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** functions.c 30 Sep 2003 01:01:31 -0000 1.11 --- functions.c 9 Aug 2004 00:31:08 -0000 1.12 *************** *** 82,85 **** --- 82,86 ---- XFUNCTION(fun_btloadmap) XFUNCTION(fun_btloadmech) + XFUNCTION(fun_btmechfreqs) XFUNCTION(fun_cwho); XFUNCTION(fun_clist); *************** *** 2260,2264 **** FUNCTION(fun_mul) { ! int i, got_one; double prod; --- 2261,2265 ---- FUNCTION(fun_mul) { ! int i; double prod; *************** *** 5115,5119 **** {"BTMAKEPILOTROLL", fun_btmakepilotroll, 3, 0, CA_WIZARD}, {"BTSETXCODEVALUE", fun_btsetxcodevalue, 3, 0, CA_WIZARD}, ! {"BTSTORES", fun_btstores, 2, 0, CA_WIZARD}, {"BTDAMAGES", fun_btdamages, 1, 0, CA_WIZARD}, {"BTCRITSTATUS",fun_btcritstatus,2,0, CA_WIZARD}, --- 5116,5120 ---- {"BTMAKEPILOTROLL", fun_btmakepilotroll, 3, 0, CA_WIZARD}, {"BTSETXCODEVALUE", fun_btsetxcodevalue, 3, 0, CA_WIZARD}, ! {"BTSTORES", fun_btstores, 0, FN_VARARGS, CA_WIZARD}, {"BTDAMAGES", fun_btdamages, 1, 0, CA_WIZARD}, {"BTCRITSTATUS",fun_btcritstatus,2,0, CA_WIZARD}, *************** *** 5138,5141 **** --- 5139,5143 ---- {"BTLOADMAP", fun_btloadmap, 2, FN_VARARGS, CA_WIZARD}, {"BTLOADMECH", fun_btloadmech, 2, 0, CA_WIZARD}, + {"BTMECHFREQS", fun_btmechfreqs, 1, 0, CA_WIZARD}, #endif {"CAPSTR", fun_capstr, -1, 0, CA_PUBLIC}, Index: game.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/game.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** game.c 1 May 2002 15:11:14 -0000 1.4 --- game.c 9 Aug 2004 00:31:08 -0000 1.5 *************** *** 884,888 **** char *message; { ! int fd; ResetSpecialObjects(); --- 884,888 ---- char *message; { ! FILE * fs; ResetSpecialObjects(); *************** *** 904,912 **** log_text(message); ENDLOG; ! } fd = tf_open(mudconf.status_file, O_RDWR | O_CREAT | O_TRUNC); ! (void) write(fd, message, strlen(message)); ! (void) write(fd, (char *) "\n", 1); ! tf_close(fd); /* --- 904,912 ---- log_text(message); ENDLOG; ! } ! fs = fopen(mudconf.status_file, "w"); ! fprintf(fs, "%s\n", message); ! fclose(fs); /* *************** *** 962,969 **** if (dump_type == DUMP_CRASHED) { unlink(mudconf.crashdb); ! f = tf_fopen(mudconf.crashdb, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening crash file", --- 962,969 ---- if (dump_type == DUMP_CRASHED) { unlink(mudconf.crashdb); ! f = fopen(mudconf.crashdb, "w"); if (f != NULL) { db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening crash file", *************** *** 982,990 **** if (dump_type == DUMP_RESTART) { ! f = tf_fopen(mudconf.indb, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening restart file", --- 982,990 ---- if (dump_type == DUMP_RESTART) { ! f = fopen(mudconf.indb, "w"); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening restart file", *************** *** 1004,1012 **** if (dump_type == DUMP_KILLED) { sprintf(tmpfile, "%s.KILLED", mudconf.indb); ! f = tf_fopen(tmpfile, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening killed file", mudconf.indb); --- 1004,1012 ---- if (dump_type == DUMP_KILLED) { sprintf(tmpfile, "%s.KILLED", mudconf.indb); ! f = fopen(tmpfile, "w"); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening killed file", mudconf.indb); *************** *** 1044,1052 **** StringCopy(outfn, mudconf.outdb); strcat(outfn, ".gz"); ! f = tf_popen(tprintf("%s > %s", mudconf.compress, tmpfile), ! O_WRONLY); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! tf_pclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, outfn) < 0) --- 1044,1051 ---- StringCopy(outfn, mudconf.outdb); strcat(outfn, ".gz"); ! f = popen(tprintf("%s > %s", mudconf.compress, tmpfile), "w"); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! pclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, outfn) < 0) *************** *** 1060,1067 **** * VMS */ ! f = tf_fopen(tmpfile, O_WRONLY | O_CREAT | O_TRUNC); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! tf_fclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, mudconf.outdb) < 0) --- 1059,1066 ---- * VMS */ ! f = fopen(tmpfile, "w"); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! fclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, mudconf.outdb) < 0) *************** *** 1212,1217 **** strcat(infile, ".gz"); if (stat(infile, &statbuf) == 0) { ! if ((f = tf_popen(tprintf(" %s < %s", mudconf.uncompress, ! infile), O_RDONLY)) != NULL) compressed = 1; } --- 1211,1216 ---- strcat(infile, ".gz"); if (stat(infile, &statbuf) == 0) { ! if ((f = popen(tprintf(" %s < %s", mudconf.uncompress, ! infile), "r")) != NULL) compressed = 1; } *************** *** 1222,1226 **** if (compressed == 0) { StringCopy(infile, mudconf.indb); ! if ((f = tf_fopen(mudconf.indb, O_RDONLY)) == NULL) return -1; } --- 1221,1225 ---- if (compressed == 0) { StringCopy(infile, mudconf.indb); ! if ((f = fopen(mudconf.indb, "r")) == NULL) return -1; } *************** *** 1233,1243 **** log_text(infile); ENDLOG; ! } if (db_read(f, &db_format, &db_version, &db_flags) < 0) { STARTLOG(LOG_ALWAYS, "INI", "FATAL") { log_text((char *) "Error loading "); log_text(infile); ENDLOG; ! } return -1; } if (mudconf.have_comsys || mudconf.have_macros) load_comsys_and_macros(); --- 1232,1253 ---- log_text(infile); ENDLOG; ! }; ! if (db_read(f, &db_format, &db_version, &db_flags) < 0) { STARTLOG(LOG_ALWAYS, "INI", "FATAL") { log_text((char *) "Error loading "); log_text(infile); ENDLOG; ! } ! if (compressed) ! pclose(f); ! else ! fclose(f); ! return -1; } + if (compressed) + pclose(f); + else + fclose(f); + if (mudconf.have_comsys || mudconf.have_macros) load_comsys_and_macros(); *************** *** 1259,1273 **** * everything ok */ - #ifndef VMS - if (compressed) - tf_pclose(f); - else - tf_fclose(f); - #else - tf_fclose(f); - #endif /* - * VMS - */ - return (0); } --- 1269,1272 ---- *************** *** 1442,1448 **** exit(1); } fclose(stdin); fclose(stdout); ! #if defined(HAVE_IEEEFP_H) && defined(HAVE_SYS_UCONTEXT_H) --- 1441,1449 ---- exit(1); } + + #ifdef CLOSE_STDIN fclose(stdin); fclose(stdout); ! #endif #if defined(HAVE_IEEEFP_H) && defined(HAVE_SYS_UCONTEXT_H) *************** *** 1454,1458 **** #endif - tf_init(); #ifdef RADIX_COMPRESSION init_string_compress(); --- 1455,1458 ---- Index: help.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/help.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** help.c 7 Jan 2002 09:58:32 -0000 1.2 --- help.c 9 Aug 2004 00:31:08 -0000 1.3 *************** *** 59,63 **** hashflush(htab, 0); ! if ((fp = tf_fopen(filename, O_RDONLY)) == NULL) { STARTLOG(LOG_PROBLEMS, "HLP", "RINDX") { p = alloc_lbuf("helpindex_read.LOG"); --- 59,63 ---- hashflush(htab, 0); ! if ((fp = fopen(filename, "r")) == NULL) { STARTLOG(LOG_PROBLEMS, "HLP", "RINDX") { p = alloc_lbuf("helpindex_read.LOG"); *************** *** 114,118 **** free(htab_entry); } ! tf_fclose(fp); hashreset(htab); return count; --- 114,118 ---- free(htab_entry); } ! fclose(fp); hashreset(htab); return count; *************** *** 195,199 **** return; } ! if ((fp = tf_fopen(filename, O_RDONLY)) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); STARTLOG(LOG_PROBLEMS, "HLP", "OPEN") { --- 195,199 ---- return; } ! if ((fp = fopen(filename, "r")) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); STARTLOG(LOG_PROBLEMS, "HLP", "OPEN") { *************** *** 215,219 **** ENDLOG; } ! tf_fclose(fp); return; --- 215,219 ---- ENDLOG; } ! fclose(fp); return; *************** *** 240,244 **** notify(player, line); } ! tf_fclose(fp); free_lbuf(line); free_lbuf(result); --- 240,244 ---- notify(player, line); } ! fclose(fp); free_lbuf(line); free_lbuf(result); Index: macro.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/macro.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** macro.c 1 May 2002 15:11:14 -0000 1.2 --- macro.c 9 Aug 2004 00:31:08 -0000 1.3 *************** *** 528,538 **** cmd = alias; for (; *cmd && *cmd != ' ' && *cmd != '='; cmd++); ! if (!*cmd) { notify(player, "MACRO: You must specify an = in your macro definition"); return; } - while (*cmd && *cmd != '=') - *cmd++ = 0; *cmd++ = 0; while (*cmd && *cmd == ' ') --- 528,538 ---- cmd = alias; for (; *cmd && *cmd != ' ' && *cmd != '='; cmd++); ! while (*cmd && *cmd == ' ') ! *cmd++ = '\0'; ! if (*cmd != '=') { notify(player, "MACRO: You must specify an = in your macro definition"); return; } *cmd++ = 0; while (*cmd && *cmd == ' ') Index: mail.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/mail.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** mail.c 3 Jan 2002 01:00:12 -0000 1.1.1.1 --- mail.c 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 2489,2493 **** { struct mail *mp, *nextp; ! struct tm then_tm; time_t then, now = time(0); time_t expire_secs = mudconf.mail_expiration * 86400; --- 2489,2493 ---- { struct mail *mp, *nextp; ! struct tm then_tm = { 0 }; time_t then, now = time(0); time_t expire_secs = mudconf.mail_expiration * 86400; Index: p.db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/p.db.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** p.db.h 3 Jan 2002 01:00:08 -0000 1.1.1.1 --- p.db.h 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 14,24 **** /* db.c */ - void tf_init(void); - int tf_open(char *fname, int mode); - int tf_socket(int fam, int typ); - void tf_close(int fdes); - FILE *tf_fopen(char *fname, int mode); - void tf_fclose(FILE * fd); - FILE *tf_popen(char *fname, int mode); void fwdlist_set(dbref thing, FWDLIST * ifp); void fwdlist_clr(dbref thing); --- 14,17 ---- Index: p.sa-db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/p.sa-db.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** p.sa-db.h 3 Jan 2002 00:59:30 -0000 1.1.1.1 --- p.sa-db.h 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 14,23 **** /* sa-db.c */ - void tf_init(void); - int tf_open(char *fname, int mode); - void tf_close(int fdes); - FILE *tf_fopen(char *fname, int mode); - void tf_fclose(FILE * fd); - FILE *tf_popen(char *fname, int mode); int fwdlist_load(FWDLIST * fp, dbref player, char *atext); int fwdlist_rewrite(FWDLIST * fp, char *atext); --- 14,17 ---- Index: predicates.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/predicates.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** predicates.c 3 Jan 2002 00:59:30 -0000 1.1.1.1 --- predicates.c 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 41,45 **** #endif { ! static char buff[20000]; va_list ap; --- 41,45 ---- #endif { ! static char buff[LBUF_SIZE]; va_list ap; *************** *** 53,57 **** #endif ! vsprintf(buff, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; --- 53,57 ---- #endif ! vsnprintf(buff, LBUF_SIZE, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; *************** *** 66,70 **** #endif { ! static char buff[20000]; va_list ap; --- 66,70 ---- #endif { ! static char buff[LBUF_SIZE]; va_list ap; *************** *** 86,90 **** */ ! vsprintf(buff, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; --- 86,90 ---- */ ! vsnprintf(buff, LBUF_SIZE, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; Index: wiz.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/wiz.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wiz.c 30 Sep 2003 01:01:31 -0000 1.2 --- wiz.c 9 Aug 2004 00:31:08 -0000 1.3 *************** *** 44,48 **** char *arg1, *arg2; { ! dbref victim, destination, loc; char *to; int hush = 0; --- 44,48 ---- char *arg1, *arg2; { ! dbref victim, destination, loc, exitloc; char *to; int hush = 0; *************** *** 74,78 **** */ ! if (!Has_location(victim)) { notify_quiet(player, "You can't teleport that."); return; --- 74,78 ---- */ ! if (!Has_location(victim) && Typeof(victim) != TYPE_EXIT) { notify_quiet(player, "You can't teleport that."); return; *************** *** 88,95 **** } /* ! * Check for teleporting home */ ! if (!string_compare(to, "home")) { (void) move_via_teleport(victim, HOME, cause, 0); return; --- 88,96 ---- } /* ! * Check for teleporting home ! * Also, can't teleport exits 'home' */ ! if (!string_compare(to, "home") && Typeof(victim) != TYPE_EXIT) { (void) move_via_teleport(victim, HOME, cause, 0); return; *************** *** 126,131 **** /* * If fascist teleport is on, you must control the victim's ultimate ! * * * * * location (after LEAVEing any objects) or it must be ! * JUMP_OK. */ --- 127,131 ---- /* * If fascist teleport is on, you must control the victim's ultimate ! * location (after LEAVEing any objects) or it must be JUMP_OK. */ *************** *** 167,175 **** hush = HUSH_ENTER | HUSH_LEAVE; ! if (move_via_teleport(victim, destination, cause, hush)) { ! if (player != victim) { ! if (!Quiet(player)) notify_quiet(player, "Teleported."); - } } } else if (isExit(destination)) { --- 167,181 ---- hush = HUSH_ENTER | HUSH_LEAVE; ! if (Typeof(victim) == TYPE_EXIT) { ! exitloc = Exits(victim); ! s_Exits(exitloc, remove_first(Exits(exitloc), victim)); ! s_Exits(destination, insert_first(Exits(destination), victim)); ! s_Exits(victim, destination); ! ! if (!Quiet(player)) ! notify_quiet(player, "Exit teleported."); ! } else if (move_via_teleport(victim, destination, cause, hush)) { ! if (player != victim && !Quiet(player)) notify_quiet(player, "Teleported."); } } else if (isExit(destination)) { |
From: Thomas W. <two...@us...> - 2004-08-09 00:31:54
|
Update of /cvsroot/btech/btechmux/src/hcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19526/src/hcode Modified Files: glue.c glue.hcode.c glue.scode.c 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: glue.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** glue.c 30 Sep 2003 01:01:31 -0000 1.7 --- glue.c 9 Aug 2004 00:31:11 -0000 1.8 *************** *** 178,182 **** } ! #define OkayHcode(a) (Hardcode(a) && !Zombie(a)) /* Main entry point */ --- 178,182 ---- } ! #define OkayHcode(a) (a >= 0 && Hardcode(a) && !Zombie(a)) /* Main entry point */ Index: glue.hcode.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.hcode.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** glue.hcode.c 3 Jan 2002 01:00:27 -0000 1.1.1.1 --- glue.hcode.c 9 Aug 2004 00:31:11 -0000 1.2 *************** *** 114,118 **** int silly_parseattributes(char *buffer, char **args, int max) { ! char bufferi[LBUF_SIZE], foobuff[LBUF_SIZE]; char *a, *b; int count = 0; --- 114,118 ---- int silly_parseattributes(char *buffer, char **args, int max) { ! static char bufferi[LBUF_SIZE], foobuff[LBUF_SIZE]; char *a, *b; int count = 0; *************** *** 153,157 **** args[max - 1] = foobuff; } ! return (num_args); } --- 153,157 ---- args[max - 1] = foobuff; } ! return num_args; } *************** *** 172,175 **** /* buffer */ } ! return (num_args); } --- 172,175 ---- /* buffer */ } ! return num_args; } Index: glue.scode.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.scode.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** glue.scode.c 30 Sep 2003 01:01:31 -0000 1.6 --- glue.scode.c 9 Aug 2004 00:31:11 -0000 1.7 *************** *** 44,47 **** --- 44,48 ---- #include "p.event.h" #include "p.mech.restrict.h" + #include "mech.partnames.h" extern SpecialObjectStruct SpecialObjects[]; *************** *** 56,59 **** --- 57,61 ---- int rel_addr; int type; + int size; } GMV; *************** *** 68,77 **** enum { TYPE_STRING, TYPE_CHAR, TYPE_SHORT, TYPE_INT, TYPE_FLOAT, TYPE_DBREF, TYPE_STRFUNC, TYPE_STRFUNC_S, TYPE_BV, ! TYPE_STRFUNC_BD, TYPE_CBV }; /* INDENT OFF */ ! /* st ch sh in fl db sf sfs bv sfb cbv */ ! static int scode_in_out[] = { 3, 3, 3, 3, 3, 3, 1, 2, 3, 3, 3 }; /* INDENT ON */ --- 70,81 ---- enum { TYPE_STRING, TYPE_CHAR, TYPE_SHORT, TYPE_INT, TYPE_FLOAT, TYPE_DBREF, TYPE_STRFUNC, TYPE_STRFUNC_S, TYPE_BV, ! TYPE_STRFUNC_BD, TYPE_CBV, TYPE_CHAR_RO, TYPE_SHORT_RO, TYPE_INT_RO, ! TYPE_FLOAT_RO, TYPE_DBREF_RO, TYPE_LAST_TYPE }; /* INDENT OFF */ ! static int scode_in_out[TYPE_LAST_TYPE] = ! /* st ch sh in fl db sf sfs bv sfb cbv ro-ch ro-sh ro-in ro-fl ro-db*/ ! { 3, 3, 3, 3, 3, 3, 1, 2, 3, 3, 3, 1, 1, 1, 1, 1 }; /* INDENT ON */ *************** *** 81,112 **** #define MeEntry(Name,Func,Type) \ ! {GTYPE_MECH,Name,Uglie(Func),Type} #define MeVEntry(Name,Func,Val,Type) \ ! {GTYPE_MECH,Name,UglieV(Func,Val),Type} #define UglieM(dat) ((int) &tmpmap.dat) - ((int) &tmpmap) #define MaEntry(Name,Func,Type) \ ! {GTYPE_MAP,Name,UglieM(Func),Type} #define UglieT(dat) ((int) &tmpturret.dat) - ((int) &tmpturret) #define TuEntry(Name,Func,Type) \ ! {GTYPE_TURRET,Name,UglieT(Func),Type} #define UglieC(dat) ((int) &tmpcustom.dat) - ((int) &tmpcustom) #define CuEntry(Name,Func,Type) \ ! {GTYPE_CUSTOM,Name,UglieC(Func),Type} #define UglieScen(dat) ((int) &tmpscen.dat) - ((int) &tmpscen) #define SEntry(Name,Func,Type) \ ! {GTYPE_SCEN,Name,UglieScen(Func),Type} #define UglieSside(dat) ((int) &tmpsside.dat) - ((int) &tmpsside) #define SSEntry(Name,Func,Type) \ ! {GTYPE_SSIDE,Name,UglieSside(Func),Type} #define UglieSsobj(dat) ((int) &tmpssobj.dat) - ((int) &tmpssobj) #define SSOEntry(Name,Func,Type) \ ! {GTYPE_SSOBJ,Name,UglieSsobj(Func),Type} --- 85,131 ---- #define MeEntry(Name,Func,Type) \ ! {GTYPE_MECH,Name,Uglie(Func),Type,0} ! ! #define MeEntryS(Name,Func,Type,Size) \ ! {GTYPE_MECH,Name,Uglie(Func),Type,Size} #define MeVEntry(Name,Func,Val,Type) \ ! {GTYPE_MECH,Name,UglieV(Func,Val),Type,0} #define UglieM(dat) ((int) &tmpmap.dat) - ((int) &tmpmap) #define MaEntry(Name,Func,Type) \ ! {GTYPE_MAP,Name,UglieM(Func),Type,0} ! #define MaEntryS(Name,Func,Type,Size) \ ! {GTYPE_MAP,Name,UglieM(Func),Type,Size} #define UglieT(dat) ((int) &tmpturret.dat) - ((int) &tmpturret) #define TuEntry(Name,Func,Type) \ ! {GTYPE_TURRET,Name,UglieT(Func),Type,0} ! #define TuEntryS(Name,Func,Type,Size) \ ! {GTYPE_TURRET,Name,UglieT(Func),Type,Size} #define UglieC(dat) ((int) &tmpcustom.dat) - ((int) &tmpcustom) #define CuEntry(Name,Func,Type) \ ! {GTYPE_CUSTOM,Name,UglieC(Func),Type,0} ! #define CuEntryS(Name,Func,Type,Size) \ ! {GTYPE_CUSTOM,Name,UglieC(Func),Type,Size} #define UglieScen(dat) ((int) &tmpscen.dat) - ((int) &tmpscen) #define SEntry(Name,Func,Type) \ ! {GTYPE_SCEN,Name,UglieScen(Func),Type,0} ! #define SEntryS(Name,Func,Type,Size) \ ! {GTYPE_SCEN,Name,UglieScen(Func),Type,Size} #define UglieSside(dat) ((int) &tmpsside.dat) - ((int) &tmpsside) #define SSEntry(Name,Func,Type) \ ! {GTYPE_SSIDE,Name,UglieSside(Func),Type,0} ! #define SSEntryS(Name,Func,Type,Size) \ ! {GTYPE_SSIDE,Name,UglieSside(Func),Type,Size} #define UglieSsobj(dat) ((int) &tmpssobj.dat) - ((int) &tmpssobj) #define SSOEntry(Name,Func,Type) \ ! {GTYPE_SSOBJ,Name,UglieSsobj(Func),Type,0} ! #define SSOEntryS(Name,Func,Type,Size) \ ! {GTYPE_SSOBJ,Name,UglieSsobj(Func),Type,Size} *************** *** 420,427 **** {GTYPE_MECH, "mapindex", ((int) &tmpm.mapindex) - ((int) &tmpm), ! TYPE_DBREF}, {GTYPE_MECH, "id", (int) mechIDfunc, TYPE_STRFUNC}, ! MeEntry("mechname", MechType_Name, TYPE_STRING), MeEntry("maxspeed", MechMaxSpeed, TYPE_FLOAT), MeEntry("pilotnum", MechPilot, TYPE_DBREF), --- 439,446 ---- {GTYPE_MECH, "mapindex", ((int) &tmpm.mapindex) - ((int) &tmpm), ! TYPE_DBREF_RO}, {GTYPE_MECH, "id", (int) mechIDfunc, TYPE_STRFUNC}, ! MeEntryS("mechname", MechType_Name, TYPE_STRING, 31), MeEntry("maxspeed", MechMaxSpeed, TYPE_FLOAT), MeEntry("pilotnum", MechPilot, TYPE_DBREF), *************** *** 441,454 **** MeEntry("team", MechTeam, TYPE_INT), MeEntry("tons", MechTons, TYPE_INT), ! MeEntry("towing", MechCarrying, TYPE_INT), MeEntry("heat", MechPlusHeat, TYPE_FLOAT), ! MeEntry("disabled_hs", MechDisabledHS, TYPE_INT), MeEntry("overheat", MechHeat, TYPE_FLOAT), MeEntry("dissheat", MechMinusHeat, TYPE_FLOAT), MeEntry("last_startup", MechLastStartup, TYPE_INT), ! MeEntry("C3iNetworkSize", MechC3iNetworkSize, TYPE_INT), MeEntry("MaxSuits", MechMaxSuits, TYPE_INT), MeEntry("realweight", MechRTonsV, TYPE_INT), ! MeEntry("StaggerDamage", StaggerDamage, TYPE_INT), #ifdef BT_ENABLED --- 460,474 ---- MeEntry("team", MechTeam, TYPE_INT), MeEntry("tons", MechTons, TYPE_INT), ! MeEntry("towing", MechCarrying, TYPE_INT_RO), MeEntry("heat", MechPlusHeat, TYPE_FLOAT), ! MeEntry("disabled_hs", MechDisabledHS, TYPE_INT_RO), MeEntry("overheat", MechHeat, TYPE_FLOAT), MeEntry("dissheat", MechMinusHeat, TYPE_FLOAT), MeEntry("last_startup", MechLastStartup, TYPE_INT), ! MeEntry("C3iNetworkSize", MechC3iNetworkSize, TYPE_INT_RO), MeEntry("MaxSuits", MechMaxSuits, TYPE_INT), MeEntry("realweight", MechRTonsV, TYPE_INT), ! MeEntry("StaggerDamage", StaggerDamage, TYPE_INT_RO), ! MeEntry("MechPrefs", MechPrefs, TYPE_BV), #ifdef BT_ENABLED *************** *** 465,469 **** MeEntry("fuel", AeroFuel, TYPE_INT), MeEntry("fuel_orig", AeroFuelOrig, TYPE_INT), ! MeEntry("cocoon", MechCocoon, TYPE_INT), MeEntry("numseen", MechNumSeen, TYPE_SHORT), --- 485,489 ---- MeEntry("fuel", AeroFuel, TYPE_INT), MeEntry("fuel_orig", AeroFuelOrig, TYPE_INT), ! MeEntry("cocoon", MechCocoon, TYPE_INT_RO), MeEntry("numseen", MechNumSeen, TYPE_SHORT), *************** *** 492,496 **** MeVEntry("turret2", AeroTurret, 2, TYPE_DBREF), ! MeEntry("unusablearcs", AeroUnusableArcs, TYPE_INT), MeEntry("maxjumpspeed", MechJumpSpeed, TYPE_FLOAT), MeEntry("jumpheading", MechJumpHeading, TYPE_SHORT), --- 512,516 ---- MeVEntry("turret2", AeroTurret, 2, TYPE_DBREF), ! MeEntry("unusablearcs", AeroUnusableArcs, TYPE_INT_RO), MeEntry("maxjumpspeed", MechJumpSpeed, TYPE_FLOAT), MeEntry("jumpheading", MechJumpHeading, TYPE_SHORT), *************** *** 498,512 **** MaEntry("buildflag", buildflag, TYPE_CHAR), ! MaEntry("buildonmap", onmap, TYPE_DBREF), MaEntry("cf", cf, TYPE_SHORT), MaEntry("cfmax", cfmax, TYPE_SHORT), MaEntry("gravity", grav, TYPE_CHAR), MaEntry("maxcf", cfmax, TYPE_SHORT), ! MaEntry("firstfree", first_free, TYPE_CHAR), ! MaEntry("mapheight", map_height, TYPE_SHORT), MaEntry("maplight", maplight, TYPE_CHAR), ! MaEntry("mapname", mapname, TYPE_STRING), MaEntry("mapvis", mapvis, TYPE_CHAR), ! MaEntry("mapwidth", map_width, TYPE_SHORT), MaEntry("maxvis", maxvis, TYPE_SHORT), MaEntry("temperature", temp, TYPE_CHAR), --- 518,532 ---- MaEntry("buildflag", buildflag, TYPE_CHAR), ! MaEntry("buildonmap", onmap, TYPE_DBREF_RO), MaEntry("cf", cf, TYPE_SHORT), MaEntry("cfmax", cfmax, TYPE_SHORT), MaEntry("gravity", grav, TYPE_CHAR), MaEntry("maxcf", cfmax, TYPE_SHORT), ! MaEntry("firstfree", first_free, TYPE_CHAR_RO), ! MaEntry("mapheight", map_height, TYPE_SHORT_RO), MaEntry("maplight", maplight, TYPE_CHAR), ! MaEntryS("mapname", mapname, TYPE_STRING, 30), MaEntry("mapvis", mapvis, TYPE_CHAR), ! MaEntry("mapwidth", map_width, TYPE_SHORT_RO), MaEntry("maxvis", maxvis, TYPE_SHORT), MaEntry("temperature", temp, TYPE_CHAR), *************** *** 537,541 **** SEntry("end", end_t, TYPE_INT), ! SSEntry("slet", slet, TYPE_STRING), SSOEntry("state", state, TYPE_INT), --- 557,561 ---- SEntry("end", end_t, TYPE_INT), ! SSEntryS("slet", slet, TYPE_STRING, 10), SSOEntry("state", state, TYPE_INT), *************** *** 576,580 **** break; case TYPE_STRING: ! strcpy((char *) bar, fargs[2]); break; case TYPE_DBREF: --- 596,601 ---- break; case TYPE_STRING: ! strncpy((char *) bar, fargs[2], xcode_data[i].size - 1); ! ((char *)bar)[xcode_data[i].size - 1] = '\0'; break; case TYPE_DBREF: *************** *** 623,638 **** --- 644,664 ---- break; case TYPE_DBREF: + case TYPE_DBREF_RO: sprintf(buf, "%d", (dbref) * ((dbref *) bar)); break; case TYPE_CHAR: + case TYPE_CHAR_RO: sprintf(buf, "%d", (char) *((char *) bar)); break; case TYPE_SHORT: + case TYPE_SHORT_RO: sprintf(buf, "%d", (short) *((short *) bar)); break; case TYPE_INT: + case TYPE_INT_RO: sprintf(buf, "%d", (int) *((int *) bar)); break; case TYPE_FLOAT: + case TYPE_FLOAT_RO: sprintf(buf, "%.2f", (float) *((float *) bar)); break; *************** *** 731,735 **** break; case TYPE_STRING: ! strcpy((char *) bar, args[1]); break; case TYPE_DBREF: --- 757,762 ---- break; case TYPE_STRING: ! strncpy((char *) bar, args[1], xcode_data[i].size - 1); ! ((char *)bar)[xcode_data[i].size - 1] = '\0'; break; case TYPE_DBREF: *************** *** 824,847 **** FUNCTION(fun_btstores) { ! /* fargs[0] = id of the bay */ ! /* fargs[1] = name of the part */ dbref it; ! int i, spec; ! void *foo; int p, b; - it = match_thing(player, fargs[0]); - FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); - spec = WhichSpecial(it); - FUNCHECK(!(foo = FindObjectsData(it)), "#-1"); FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); ! i = -1; ! if (!find_matching_long_part(fargs[1], &i, &p, &b)) { i = -1; ! FUNCHECK(!find_matching_vlong_part(fargs[1], &i, &p, &b), ! "#-1 INVALID PART NAME"); } - safe_tprintf_str(buff, bufc, "%d", econ_find_items(it, p, b)); - return; } --- 851,895 ---- FUNCTION(fun_btstores) { ! /* fargs[0] = id of the bay/mech */ ! /* fargs[1] = (optional) name of the part */ dbref it; ! int i, x = 0; int p, b; + int pile[BRANDCOUNT + 1][NUM_ITEMS]; + char *t; FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); ! FUNCHECK(nfargs < 1 || nfargs > 2, ! "#-1 FUNCTION (BTSTORES) EXPECTS 1 OR 2 ARGUMENTS"); ! it = match_thing(player, fargs[0]); ! FUNCHECK(!Good_obj(it), "#-1 INVALID TARGET"); ! if (nfargs > 1) { i = -1; ! if (!find_matching_long_part(fargs[1], &i, &p, &b)) { ! i = -1; ! FUNCHECK(!find_matching_vlong_part(fargs[1], &i, &p, &b), ! "#-1 INVALID PART NAME"); ! } ! safe_tprintf_str(buff, bufc, "%d", econ_find_items(it, p, b)); ! } else { ! memset(pile, 0, sizeof(pile)); ! t = silly_atr_get(it, A_ECONPARTS); ! while (*t) { ! if (*t == '[') ! if ((sscanf(t, "[%d,%d,%d]", &i, &p, &b)) == 3) ! pile[p][i] += b; ! t++; ! } ! for (i = 0; i < object_count; i++) { ! UNPACK_PART(short_sorted[i]->index, p, b); ! if (pile[b][p]) { ! if (x) ! safe_str("|", buff, bufc); ! x = pile[b][p]; ! safe_tprintf_str(buff, bufc, "%s:%d", ! part_name_long(p, b), x); ! } ! } } } *************** *** 1138,1143 **** FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); FUNCHECK(!(mech = FindObjectsData(it)), "#-1 UNABLE TO GET MECHDATA"); ! FUNCHECK(Readnum(totaldam, fargs[1]), "#-1 INVALID 2ND ARG"); ! FUNCHECK(Readnum(clustersize, fargs[2]), "#-1 INVALID 3RD ARG"); FUNCHECK(Readnum(direction, fargs[3]), "#-1 INVALID 4TH ARG"); FUNCHECK(Readnum(iscrit, fargs[4]), "#-1 INVALID 5TH ARG"); --- 1186,1193 ---- FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); FUNCHECK(!(mech = FindObjectsData(it)), "#-1 UNABLE TO GET MECHDATA"); ! FUNCHECK(Readnum(totaldam, fargs[1]) || totaldam < 1, ! "#-1 INVALID 2ND ARG"); ! FUNCHECK(Readnum(clustersize, fargs[2]) || clustersize < 1, ! "#-1 INVALID 3RD ARG"); FUNCHECK(Readnum(direction, fargs[3]), "#-1 INVALID 4TH ARG"); FUNCHECK(Readnum(iscrit, fargs[4]), "#-1 INVALID 5TH ARG"); *************** *** 1256,1261 **** /* fargs[0] = mech fargs[1] = target ID */ - MECH *mech; MECH *target; dbref mechnum; --- 1306,1311 ---- /* fargs[0] = mech fargs[1] = target ID */ MECH *target; + MECH *mech = NULL; dbref mechnum; *************** *** 1263,1276 **** mechnum = match_thing(player, fargs[0]); FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), ! "#-1 INVALID MECH"); ! FUNCHECK(!IsMech(mechnum), "#-1 INVALID MECH"); ! FUNCHECK(!(mech = getMech(mechnum)), "#-1 INVALID MECH"); FUNCHECK(strlen(fargs[1]) != 2, "#-1 INVALID TARGETID"); ! mechnum = FindTargetDBREFFromMapNumber(mech, fargs[1]); FUNCHECK(mechnum < 0, "#-1 INVALID TARGETID"); ! FUNCHECK(!(target = getMech(mechnum)), "#-1 INVALID TARGETID"); ! FUNCHECK(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), ! FlMechRange(getMap(mech->mapindex), mech, target)), ! "#-1 INVALID TARGETID"); safe_tprintf_str(buff, bufc, "#%d", (int) mechnum); } --- 1313,1336 ---- mechnum = match_thing(player, fargs[0]); FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), ! "#-1 INVALID MECH/MAP"); FUNCHECK(strlen(fargs[1]) != 2, "#-1 INVALID TARGETID"); ! if (IsMech(mechnum)) { ! FUNCHECK(!(mech = getMech(mechnum)), "#-1 INVALID MECH"); ! mechnum = FindTargetDBREFFromMapNumber(mech, fargs[1]); ! } else if (IsMap(mechnum)) { ! MAP *map; ! FUNCHECK(!(map = getMap(mechnum)), "#-1 INVALID MAP"); ! mechnum = FindMechOnMap(map, fargs[1]); ! } else { ! safe_str("#-1 INVALID MECH/MAP", buff, bufc); ! return; ! } FUNCHECK(mechnum < 0, "#-1 INVALID TARGETID"); ! if (mech) { ! FUNCHECK(!(target = getMech(mechnum)), "#-1 INVALID TARGETID"); ! FUNCHECK(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), ! FlMechRange(getMap(mech->mapindex), mech, target)), ! "#-1 INVALID TARGETID"); ! } safe_tprintf_str(buff, bufc, "#%d", (int) mechnum); } *************** *** 1286,1289 **** --- 1346,1350 ---- MAP *map; int x = -1, y = -1, mechnum; + float fx, fy; FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); *************** *** 1299,1304 **** FUNCHECK(x < 0 || x > map->map_width || y < 0 || y > map->map_height, "#-1 INVALID COORDINATES"); if (InLineOfSight_NB(mech, NULL, x, y, ! FindHexRange(MechFX(mech), MechFY(mech), x, y))) safe_tprintf_str(buff, bufc, "1"); else --- 1360,1366 ---- FUNCHECK(x < 0 || x > map->map_width || y < 0 || y > map->map_height, "#-1 INVALID COORDINATES"); + MapCoordToRealCoord(x, y, &fx, &fy); if (InLineOfSight_NB(mech, NULL, x, y, ! FindHexRange(MechFX(mech), MechFY(mech), fx, fy))) safe_tprintf_str(buff, bufc, "1"); else *************** *** 1354,1358 **** !find_matching_vlong_part(fargs[1], &index, &id, &brand) && !find_matching_long_part(fargs[1], &index, &id, &brand), "0"); - found: econ_change_items(loc, id, brand, count); SendEcon(tprintf("#%d added %d %s to #%d", player, count, --- 1416,1419 ---- *************** *** 1418,1421 **** } } ! #endif --- 1479,1513 ---- } } ! ! extern char radio_colorstr[]; ! ! FUNCTION(fun_btmechfreqs) ! { ! /* fargs[0] = mechobject ! */ ! int mechdbref; ! MECH * mech; ! int i; ! ! FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); ! mechdbref = match_thing(player, fargs[0]); ! FUNCHECK(!Good_obj(mechdbref), "#-1 INVALID TARGET"); ! mech = getMech(mechdbref); ! FUNCHECK(!mech, "#-1 INVALID TARGET"); ! ! for (i = 0; i < MFreqs(mech); i++) { ! if (i) ! safe_str(",", buff, bufc); ! safe_tprintf_str(buff, bufc, "%d|%d|%s", ! i + 1, mech->freq[i], ! bv2text(mech->freqmodes[i] % FREQ_REST)); ! if (mech->freqmodes[i] / FREQ_REST) { ! safe_tprintf_str(buff, bufc, "|%c", ! radio_colorstr[mech->freqmodes[i] / FREQ_REST - 1]); ! } else { ! safe_str("|-", buff, bufc); ! } ! } ! } ! #endif |
From: Thomas W. <two...@us...> - 2004-08-09 00:31:28
|
Update of /cvsroot/btech/btechmux/tree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19526/tree Modified Files: mux_tree.c 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: mux_tree.c =================================================================== RCS file: /cvsroot/btech/btechmux/tree/mux_tree.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mux_tree.c 2 Feb 2002 11:53:32 -0000 1.2 --- mux_tree.c 9 Aug 2004 00:31:18 -0000 1.3 *************** *** 30,33 **** --- 30,35 ---- #include <malloc.h> #include <stdio.h> + #include <stdlib.h> + #include <string.h> #include "tree.h" |
From: Thomas W. <two...@us...> - 2004-08-08 23:49:01
|
Update of /cvsroot/btech/btechmux/src/hcode/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12777/src/hcode/include Modified Files: Tag: btmux_1_4-branch glue.h macros.h Log Message: Annual (ahem) sync with the BitKeeper btechmux-stable tree (at btechmux.bkbits.net/btechmux-stable). 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: # -------------------------------------------- # 03/09/30 th...@st... 1.26 # 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/10/01 th...@st... 1.27 # 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.28.1.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.30 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/10/01 th...@ce... 1.31 # Ice glitchfixes: break through it while standing, and don't survive as tank breaking ice. # -------------------------------------------- # 03/10/01 th...@ce... 1.32 # More ice glitch fixes: properly break ice when picking a unit (but not a MechWarrior) up through it. # -------------------------------------------- # 03/10/01 th...@ce... 1.33 # Wups... don't sink hovertows. # -------------------------------------------- # 03/10/05 th...@st... 1.34 # Make MUX function 'btgetdbrefbyid' accept a map as well as a 'mech as its first argument. # -------------------------------------------- # 03/10/12 th...@st... 1.35 # - 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.36 # - Consider OOD-ing 'mechs as Jumping 'mechs where appropriate. # -------------------------------------------- # 03/10/14 th...@st... 1.37 # Add new 'c' option to LRS, for colorized terrain. # -------------------------------------------- # 03/10/14 th...@st... 1.38 # Don't cliff hovers that go from l0 bridge to l1 bridge. # -------------------------------------------- # 03/10/14 th...@st... 1.39 # Don't drown vehicles that manage to break l0 ice. # -------------------------------------------- # 03/10/15 th...@st... 1.40 # 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.41 # - Add 'tactical b', for displaying valid DropShip landing zones # - Add the ability to run 'checklz x y' for hexes in TacRange. # -------------------------------------------- # 03/10/19 th...@st... 1.42 # - 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.43 # 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.44 # Patch from Tony to make tel() and @tel 'teleport' exits the same way the 'drop' command does. # -------------------------------------------- # 03/10/21 th...@st... 1.45 # Fix eternal loop when calling btdamagemech() with a 'clustersize' of 0. # -------------------------------------------- # 03/10/31 th...@st... 1.46 # Glitchfix. # -------------------------------------------- # 03/10/31 th...@st... 1.47 # Possibly fix memory corruption problems 3030 has been having, by fixing around tprintf (as suggested by Null @ 3029.) # -------------------------------------------- # 03/11/14 th...@ce... 1.44.1.1 # Fix buglet in btlostohex(): use proper range. # -------------------------------------------- # 03/11/15 th...@st... 1.48 # Fix possibly malicious crashing bug in macros. # -------------------------------------------- # 03/11/15 th...@ce... 1.49 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/11/20 th...@st... 1.50 # Misc cleanup fixes. Stuff that probably didn't cause any real-world bugs, but should be fixed anyway. # -------------------------------------------- # 03/11/23 th...@st... 1.51 # - 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/09 th...@st... 1.52 # Fix off-by-one error in reading maps with an X size of MAPX (1000 by default.) # -------------------------------------------- # 04/02/10 th...@st... 1.53 # Open help/news files for reading, not writing. Oopsie from last changeset. # -------------------------------------------- # 04/02/12 th...@st... 1.54 # remove unused file. # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.1 # foobar changeset # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.2 # foobar2 # -------------------------------------------- # 04/05/08 th...@st... 1.55 # 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.56 # Protect some xcodevalues from being changed, to avoid memory corruption and the like. # -------------------------------------------- # 04/05/09 th...@st... 1.57 # 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.58 # Fix typo in previous checkin, and compile before checking in. # -------------------------------------------- # 04/05/11 th...@ce... 1.59 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 04/05/11 th...@ce... 1.60 # Fix compiler warnings: # - Add a few missing include files # - Remove unused variables # -------------------------------------------- # 04/05/11 th...@ce... 1.61 # 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.62 # Fix off-by-one error in the kick-decision range check in autopilots. # -------------------------------------------- # 04/07/29 th...@st... 1.63 # Attempt to improve the dieroll's randomness somewhat. # -------------------------------------------- Index: glue.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/include/glue.h,v retrieving revision 1.4.2.7 retrieving revision 1.4.2.8 diff -C2 -d -r1.4.2.7 -r1.4.2.8 *** glue.h 30 Sep 2003 01:38:36 -0000 1.4.2.7 --- glue.h 8 Aug 2004 23:48:19 -0000 1.4.2.8 *************** *** 377,382 **** mech_range}, {0, ! "LRS <M|T|E|L|S|H> [<BEARING> <RANGE> | <TARGET-ID>]", ! "Shows the long range map", mech_lrsmap}, {0, "TACTICAL [C | T | L] [<BEARING> <RANGE> | <TARGET-ID>]", "Shows the tactical map at the mech's location / at bearing and range / around chosen target", --- 377,382 ---- mech_range}, {0, ! "LRS <M|T|E|L|S|H|C> [<BEARING> <RANGE> | <TARGET-ID>]", ! "Shows the (Mech/Terrain/Elevation/LOS/Sensors/Height/Combined) long range map", mech_lrsmap}, {0, "TACTICAL [C | T | L] [<BEARING> <RANGE> | <TARGET-ID>]", "Shows the tactical map at the mech's location / at bearing and range / around chosen target", Index: macros.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/include/macros.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** macros.h 3 Jan 2002 01:01:39 -0000 1.1.1.1 --- macros.h 8 Aug 2004 23:48:19 -0000 1.1.1.1.2.1 *************** *** 51,56 **** /* Dice-rolling function used everywhere converted to a macro */ ! #define Number(a,b) ((a) + random()%((b)-(a)+1)) ! #define skipws(name) while (name && *name && isspace(*name)) name++ --- 51,63 ---- /* Dice-rolling function used everywhere converted to a macro */ ! /* Shift the random number to get rid of the usually not-very-random ! lower order bits. Because Number() is used with a wide range of numbers, ! as high as 5000 at least, we do a little dance to determine the amount ! to shift */ ! #define Number(a,b) ((a) + (random() >> ( \ ! ((b) - (a)) > 16777216 ? 0 : \ ! ((b) - (a)) > 65536 ? 8 : \ ! ((b) - (a)) > 4096 ? 16 : 20 \ ! )) % ((b)-(a)+1)) #define skipws(name) while (name && *name && isspace(*name)) name++ |
Update of /cvsroot/btech/btechmux/src/hcode/btech In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12777/src/hcode/btech Modified Files: Tag: btmux_1_4-branch aero.move.c autogun.c bsuit.c crit.c econ.c hudinfo.c map.bits.c map.build.functions.c map.c map.conditions.c mech.advanced.c mech.ammodump.c mech.bth.c mech.combat.c mech.combat.misc.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 Log Message: Annual (ahem) sync with the BitKeeper btechmux-stable tree (at btechmux.bkbits.net/btechmux-stable). 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: # -------------------------------------------- # 03/09/30 th...@st... 1.26 # 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/10/01 th...@st... 1.27 # 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.28.1.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.30 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/10/01 th...@ce... 1.31 # Ice glitchfixes: break through it while standing, and don't survive as tank breaking ice. # -------------------------------------------- # 03/10/01 th...@ce... 1.32 # More ice glitch fixes: properly break ice when picking a unit (but not a MechWarrior) up through it. # -------------------------------------------- # 03/10/01 th...@ce... 1.33 # Wups... don't sink hovertows. # -------------------------------------------- # 03/10/05 th...@st... 1.34 # Make MUX function 'btgetdbrefbyid' accept a map as well as a 'mech as its first argument. # -------------------------------------------- # 03/10/12 th...@st... 1.35 # - 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.36 # - Consider OOD-ing 'mechs as Jumping 'mechs where appropriate. # -------------------------------------------- # 03/10/14 th...@st... 1.37 # Add new 'c' option to LRS, for colorized terrain. # -------------------------------------------- # 03/10/14 th...@st... 1.38 # Don't cliff hovers that go from l0 bridge to l1 bridge. # -------------------------------------------- # 03/10/14 th...@st... 1.39 # Don't drown vehicles that manage to break l0 ice. # -------------------------------------------- # 03/10/15 th...@st... 1.40 # 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.41 # - Add 'tactical b', for displaying valid DropShip landing zones # - Add the ability to run 'checklz x y' for hexes in TacRange. # -------------------------------------------- # 03/10/19 th...@st... 1.42 # - 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.43 # 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.44 # Patch from Tony to make tel() and @tel 'teleport' exits the same way the 'drop' command does. # -------------------------------------------- # 03/10/21 th...@st... 1.45 # Fix eternal loop when calling btdamagemech() with a 'clustersize' of 0. # -------------------------------------------- # 03/10/31 th...@st... 1.46 # Glitchfix. # -------------------------------------------- # 03/10/31 th...@st... 1.47 # Possibly fix memory corruption problems 3030 has been having, by fixing around tprintf (as suggested by Null @ 3029.) # -------------------------------------------- # 03/11/14 th...@ce... 1.44.1.1 # Fix buglet in btlostohex(): use proper range. # -------------------------------------------- # 03/11/15 th...@st... 1.48 # Fix possibly malicious crashing bug in macros. # -------------------------------------------- # 03/11/15 th...@ce... 1.49 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/11/20 th...@st... 1.50 # Misc cleanup fixes. Stuff that probably didn't cause any real-world bugs, but should be fixed anyway. # -------------------------------------------- # 03/11/23 th...@st... 1.51 # - 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/09 th...@st... 1.52 # Fix off-by-one error in reading maps with an X size of MAPX (1000 by default.) # -------------------------------------------- # 04/02/10 th...@st... 1.53 # Open help/news files for reading, not writing. Oopsie from last changeset. # -------------------------------------------- # 04/02/12 th...@st... 1.54 # remove unused file. # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.1 # foobar changeset # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.2 # foobar2 # -------------------------------------------- # 04/05/08 th...@st... 1.55 # 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.56 # Protect some xcodevalues from being changed, to avoid memory corruption and the like. # -------------------------------------------- # 04/05/09 th...@st... 1.57 # 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.58 # Fix typo in previous checkin, and compile before checking in. # -------------------------------------------- # 04/05/11 th...@ce... 1.59 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 04/05/11 th...@ce... 1.60 # Fix compiler warnings: # - Add a few missing include files # - Remove unused variables # -------------------------------------------- # 04/05/11 th...@ce... 1.61 # 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.62 # Fix off-by-one error in the kick-decision range check in autopilots. # -------------------------------------------- # 04/07/29 th...@st... 1.63 # Attempt to improve the dieroll's randomness somewhat. # -------------------------------------------- Index: aero.move.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/aero.move.c,v retrieving revision 1.3.2.6 retrieving revision 1.3.2.7 diff -C2 -d -r1.3.2.6 -r1.3.2.7 *** aero.move.c 23 May 2003 23:20:13 -0000 1.3.2.6 --- aero.move.c 8 Aug 2004 23:48:16 -0000 1.3.2.7 *************** *** 246,249 **** --- 246,291 ---- } + 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) { *************** *** 310,314 **** && 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!"); --- 352,356 ---- && 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!"); *************** *** 636,678 **** } - 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) { --- 678,681 ---- *************** *** 686,690 **** void DS_LandWarning(MECH * mech, int serious) { ! int ilz = ImproperLZ(mech); if (!ilz) --- 689,693 ---- void DS_LandWarning(MECH * mech, int serious) { ! int ilz = MechCheckLZ(mech); if (!ilz) *************** *** 700,716 **** 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])); } --- 703,740 ---- 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.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** autogun.c 30 Sep 2003 01:38:35 -0000 1.1.1.1.2.1 --- autogun.c 8 Aug 2004 23:48:16 -0000 1.1.1.1.2.2 *************** *** 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.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** bsuit.c 4 Apr 2002 13:13:08 -0000 1.5.2.2 --- bsuit.c 8 Aug 2004 23:48:16 -0000 1.5.2.3 *************** *** 288,292 **** 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!"); --- 288,292 ---- 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!"); *************** *** 296,301 **** 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."); --- 296,303 ---- 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.5.2.4 retrieving revision 1.5.2.5 diff -C2 -d -r1.5.2.4 -r1.5.2.5 *** crit.c 24 Jun 2002 15:34:40 -0000 1.5.2.4 --- crit.c 8 Aug 2004 23:48:16 -0000 1.5.2.5 *************** *** 1685,1692 **** 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]; --- 1685,1688 ---- *************** *** 1695,1699 **** int tLocIsLeg = ((hitloc == LLEG || hitloc == RLEG) || ((hitloc == LARM || hitloc == RARM) && MechIsQuad(wounded))); - int firstCrit = 0; char partBuf[100]; --- 1691,1694 ---- Index: econ.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/econ.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** econ.c 3 Jan 2002 01:01:03 -0000 1.1.1.1 --- econ.c 8 Aug 2004 23:48:16 -0000 1.1.1.1.2.1 *************** *** 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.8.2.9 retrieving revision 1.8.2.10 diff -C2 -d -r1.8.2.9 -r1.8.2.10 *** hudinfo.c 10 Dec 2002 14:21:02 -0000 1.8.2.9 --- hudinfo.c 8 Aug 2004 23:48:16 -0000 1.8.2.10 *************** *** 239,243 **** { static char wstatus[12]; - int tempstat; if (PartIsBroken(mech, sect, crit)) --- 239,242 ---- *************** *** 493,497 **** { int i; - int spec; char firemodes[30] = ""; char ammomodes[20] = ""; --- 492,495 ---- *************** *** 1037,1043 **** { char response[LBUF_SIZE]; ! int sect, dummy; MECH *targ; - float range; targ = hud_scantarget(d, mech, msgclass, args); --- 1035,1040 ---- { 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.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** map.bits.c 3 Jan 2002 01:01:38 -0000 1.1.1.1 --- map.bits.c 8 Aug 2004 23:48:16 -0000 1.1.1.1.2.1 *************** *** 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.build.functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/map.build.functions.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** map.build.functions.c 6 Dec 2002 14:28:41 -0000 1.1.2.4 --- map.build.functions.c 8 Aug 2004 23:48:16 -0000 1.1.2.5 *************** *** 1,509 **** - - /* - * $Id$ - * - * Author: Cord Awtry <ki...@bs...> - * - * Copyright (c) 2002 Cord Awtry - * All rights reserved - */ - - #include "mech.h" - #include "p.mech.build.h" - #include "p.mechfile.h" - #include "p.mech.maps.h" - #include "p.template.h" - - /* Convert some of the roads to bridges */ - - /* Logic: OPPOSITE sides must have water, within r<=3 of each other */ - - extern int dirs[6][2]; - - int water_distance(MAP * map, int x, int y, int dir, int max) - { - int i; - int x2, y2; - - for (i = 1; i < max; i++) { - x = x + dirs[dir][0]; - y = y + dirs[dir][1]; - if (!x && dirs[dir][0]) - y--; - x2 = BOUNDED(0, x, map->map_width - 1); - y2 = BOUNDED(0, y, map->map_height - 1); - if (x != x2 || y != y2) - return max; - if (GetHexTerrain(map, x, y) == WATER || - GetHexTerrain(map, x, y) == ICE) - return i; - if (GetHexTerrain(map, x, y) != BRIDGE && - GetHexTerrain(map, x, y) != ROAD) - return max; - } - return max; - } - - static int eligible_bridge_hex(MAP * map, int x, int y) - { - int i, j, k; - - for (k = 0; k < 3; k++) - if ((i = water_distance(map, x, y, k, 4)) < 4) - if ((j = water_distance(map, x, y, k + 3, 4)) < 4) { - if ((i - j) > 3) - continue; - - return 1; - } - - return 0; - } - - static void make_bridges(MAP * map) - { - int x, y; - - for (x = 0; x < map->map_width; x++) - for (y = 0; y < map->map_height; y++) - if (GetHexTerrain(map, x, y) == ROAD) - if (eligible_bridge_hex(map, x, y)) - SetHexTerrain(map, x, y, BRIDGE); - } - - static void repairBrokenLayer(MAP * map, int x, int y) - { - int layers = GetHexLayers(map, x, y); - int data = GetHexLayerData(map, x, y); - - if ((layers & HEXLAYER_SNOW) || (layers & HEXLAYER_DEEP_SNOW)) { - if (data <= 0) { - if (layers & HEXLAYER_SNOW) - data = Number(1, 1000); - else - data = Number(1001, 2000); - - SetHexLayerData(map, x, y, data); - SendDebug(tprintf("Repairing the snow depth at %d %d", x, y)); - } - } else - data = 0; - } - - void loadMap(dbref player, void *data, char *buffer) - { - MAP *map; - char *args[1]; - char openfile[50]; - char terr, elev; - int i1, i2, i3, i4, i5; - FILE *fp; - char row[MAPX * 2 + 2]; - int i, j = 0, height, width, filemode; - char line[100]; - int wordsRead = 0; - - map = (MAP *) data; - - if (!CheckData(player, map)) - return; - - DOCHECK(mech_parseattributes(buffer, args, 1) != 1, - "Invalid number of arguments!"); - if (strlen(args[0]) >= MAP_NAME_SIZE) - args[MAP_NAME_SIZE] = 0; - sprintf(openfile, "%s/", MAP_PATH); - strcat(openfile, args[0]); - DOCHECK(!(fp = - my_open_file(openfile, "r", &filemode)), - tprintf("Unable to read %s!", args[0])); - del_mapobjs(map); /* Just in case */ - notify(player, tprintf("Loading %s", args[0])); - - if (fscanf(fp, "%d %d\n", &height, &width) != 2 || height < 1 || - height > MAPY || width < 1 || width > MAPX) { - SendError(tprintf("Map #%d: Invalid height and/or width", - map->mynum)); - width = DEFAULT_MAP_WIDTH; - height = DEFAULT_MAP_HEIGHT; - } - - freeOldMap(map); - initializeMap(map, width, height); - - /* Now we start to build it... */ - for (i = 0; i < height; i++) { - if (feof(fp) || fgets(row, 2 * MAPX + 1, fp) == NULL || - strlen(row) < (2 * width)) { - break; - } - - for (j = 0; j < width; j++) { - terr = row[2 * j]; - elev = row[2 * j + 1] - '0'; - - switch (terr) { - case FIRE: - map->flags |= MAPFLAG_FIRES; - break; - case TFIRE: - case SMOKE: - case '.': - terr = GRASSLAND; - break; - case '\'': - terr = LIGHT_FOREST; - break; - } - - if (!strcmp(GetTerrainName_base(terr), "Unknown")) { - SendError(tprintf - ("Map #%d: Invalid terrain at %d,%d: '%c'", map->mynum, - j, i, terr)); - terr = GRASSLAND; - } - - SetMapHexData(map, j, i, terr, elev, 0, 0); - } - } - - if (i != height) { - SendError(tprintf - ("Error: EOF reached prematurely. (x%d != %d || y%d != %d)", j, - width, i, height)); - my_close_file(fp, &filemode); - return; - } - - map->grav = 100; - map->temp = 20; - - if (!feof(fp)) { - while (fgets(line, 100, fp)) { - if ((wordsRead = - sscanf(line, "LAYER: %d %d %d %d", &i1, &i2, &i3, - &i4)) == 4) { - if (wordsRead > 2) { - SetHexLayers(map, i1, i2, i3); - - if (wordsRead > 3) - SetHexLayerData(map, i1, i2, i4); - else - SetHexLayerData(map, i1, i2, 0); - - repairBrokenLayer(map, i1, i2); - } - } else if ((wordsRead = sscanf(line, "FLAGS: %d", &i1)) == 1) { - map->flags = i1; - } else if ((wordsRead = sscanf(line, "GRAVITY: %d", &i1)) == 1) { - map->grav = i1; - } else if ((wordsRead = - sscanf(line, "TEMPERATURE: %d", &i1)) == 1) { - map->temp = i1; - } else { - SendDebug(tprintf("Invalid data read during map load: %s.", - line)); - } - } - } - - map->map_height = height; - map->map_width = width; - if (!MapNoBridgify(map)) - make_bridges(map); - sprintf(map->mapname, args[0]); - notify(player, "Loading complete!"); - my_close_file(fp, &filemode); - - notify(player, "Clearing Mechs off Newly Loaded Map"); - - if (player != 1) - map_clearmechs(player, data, ""); - } - - void saveMap(dbref player, void *data, char *buffer) - { - MAP *map; - char *args[1]; - FILE *fp; - char openfile[50]; - int i, j; - char row[MAPX * 2 + 1]; - char terrain; - int filemode; - int layer, layerData; - - map = (MAP *) data; - - if (!CheckData(player, map)) - return; - - DOCHECK(mech_parseattributes(buffer, args, 1) != 1, - "Invalid number of arguments!"); - - if (strlen(args[0]) >= MAP_NAME_SIZE) - args[MAP_NAME_SIZE] = 0; - - notify(player, tprintf("Saving %s", args[0])); - sprintf(openfile, "%s/", MAP_PATH); - strcat(openfile, args[0]); - - DOCHECK(!(fp = my_open_file(openfile, "w", &filemode)), - "Unable to open the map file!"); - - fprintf(fp, "%d %d\n", map->map_height, map->map_width); - - for (i = 0; i < map->map_height; i++) { - mapobj *mo; - - row[0] = 0; - - for (j = 0; j < map->map_width; j++) { - terrain = GetHexTerrain(map, j, i); - - switch (terrain) { - case ' ': - terrain = '.'; - break; - case FIRE: - /* check if we're burnin', if so, alter terrain type */ - if ((mo = find_mapobj(map, j, i, TYPE_FIRE))) - terrain = TFIRE; - else if (!(map->flags & MAPFLAG_FIRES)) { - SetHexTerrain(map, j, i, ' '); - SendEvent(tprintf - ("[lost?] fire event noticed on map #%d (%s) at %d,%d", - map->mynum, map->mapname, j, i)); - terrain = '.'; - } - break; - case SMOKE: - terrain = GetRTerrain(map, j, i); - - if (terrain == ' ') - terrain = '.'; - - if (terrain == SMOKE) { - SetHexTerrain(map, j, i, ' '); - SendEvent(tprintf - ("[lost?] smoke event noticed on map #%d (%s) at %d,%d", - map->mynum, map->mapname, j, i)); - terrain = '.'; - } - break; - } - - row[j * 2] = terrain; - row[j * 2 + 1] = GetHexElevation(map, j, i) + '0'; - } - - row[j * 2] = 0; - fprintf(fp, "%s\n", row); - } - - /* Write out our map data */ - fprintf(fp, "FLAGS: %d\n", map->flags); - fprintf(fp, "GRAVITY: %d\n", map->grav); - fprintf(fp, "TEMPERATURE: %d\n", map->temp); - - /* Write out our layer data */ - for (i = 0; i < map->map_height; i++) { - for (j = 0; j < map->map_width; j++) { - layer = GetHexLayers(map, j, i); - layerData = GetHexLayerData(map, j, i); - - if (layer & HEXLAYERS_TERRAIN) - fprintf(fp, "LAYER: %d %d %d %d\n", j, i, layer, - layerData); - } - } - - notify(player, "Saving complete!"); - my_close_file(fp, &filemode); - } - - void freeOldMap(MAP * map) - { - int i; - - if (!map) - return; - - if (map->hexdata) { - for (i = map->map_height - 1; i >= 0; i--) - if (map->hexdata[i]) - free(map->hexdata[i]); - - free(map->hexdata); - } - } - - HEXDATA *GetMapHexData(MAP * map, int x, int y) - { - HEXDATA *d = NULL; - - if (!map) - return NULL; - - if (x < 0 || y < 0 || x >= map->map_width || y >= map->map_height) - return NULL; - - *d = map->hexdata[x][y]; - - return d; - } - - void SetMapHexData(MAP * map, int x, int y, char terrain, char elevation, - int layers, int layerData) - { - map->hexdata[x][y].terrain = terrain; - map->hexdata[x][y].elevation = elevation; - map->hexdata[x][y].layers = layers; - map->hexdata[x][y].layerData = layerData; - } - - void ClearTerrainLayers(MAP * map, int x, int y) - { - if (!map) - return; - - map->hexdata[x][y].layers &= ~HEXLAYERS_TERRAIN; - map->hexdata[x][y].layerData = 0; - } - - void AddTerrainLayer(MAP * map, int x, int y, int layer, int layerData) - { - map->hexdata[x][y].layers |= layer; - map->hexdata[x][y].layerData = layerData; - } - - static int validateLayers(MAP * map, int x, int y, int layers) - { - int terr = UNKNOWN_TERRAIN; - int elev = 0; - - if (map) { - terr = GetHexTerrain(map, x, y); - elev = GetHexElevation(map, x, y); - } - - if (!(layers & HEXLAYERS_TERRAIN)) - return layers; - - if ((layers & HEXLAYER_SNOW) || (layers & HEXLAYER_DEEP_SNOW)) { - layers &= ~(HEXLAYER_MUD | HEXLAYER_SWAMP | HEXLAYER_RAPIDS); - - if (IsIce(terr) || IsRealWater(terr)) - layers &= ~(HEXLAYER_SNOW | HEXLAYER_DEEP_SNOW); - - if (layers & HEXLAYER_DEEP_SNOW) - layers &= ~HEXLAYER_SNOW; - } - - if (layers & HEXLAYER_MUD) { - if (IsRealWater(terr)) - layers &= ~HEXLAYER_MUD; - else - layers &= ~(HEXLAYER_SWAMP | HEXLAYER_RAPIDS); - } - - if (layers & HEXLAYER_SWAMP) { - if (!(IsGrassland(terr) || (IsRealWater(terr) && !elev))) - layers &= ~HEXLAYER_SWAMP; - else - layers &= ~HEXLAYER_RAPIDS; - } - - if (layers & HEXLAYER_RAPIDS) { - if (!(IsRealWater(terr) && (elev > 0))) - layers &= ~HEXLAYER_RAPIDS; - } - - return layers; - } - - void validateExistingLayers(MAP * map, int x, int y) - { - int curLayers, newLayers; - - curLayers = GetHexLayers(map, x, y); - newLayers = validateLayers(map, x, y, curLayers); - - if (newLayers != curLayers) - map->hexdata[x][y].layers = newLayers; - } - - void validateSnowDepth(MAP * map, int x, int y) - { - int hasSnow = HexHasSnow(map, x, y); - int hasDeepSnow = HexHasDeepSnow(map, x, y); - int data = GetHexLayerData(map, x, y); - int layers = GetHexLayers(map, x, y); - - if (data <= 0) { - layers &= ~(HEXLAYER_SNOW | HEXLAYER_DEEP_SNOW); - map->hexdata[x][y].layers = layers; - map->hexdata[x][y].layerData = 0; - - return; - } - - if (!hasSnow && !hasDeepSnow) - return; - - if ((data <= 1000) && hasDeepSnow) { - layers &= ~HEXLAYER_DEEP_SNOW; - layers |= HEXLAYER_SNOW; - - map->hexdata[x][y].layers = layers; - } else if ((data > 1000) && hasSnow) { - layers &= ~HEXLAYER_SNOW; - layers |= HEXLAYER_DEEP_SNOW; - - map->hexdata[x][y].layers = layers; - } - } - - /* Getters and Setters for the various hex related data */ - char GetHexTerrain(MAP * map, int x, int y) - { - return map->hexdata[x][y].terrain; - } - - char GetHexElevation(MAP * map, int x, int y) - { - return map->hexdata[x][y].elevation; - } - - int GetHexLayers(MAP * map, int x, int y) - { - return map->hexdata[x][y].layers; - } - - int GetHexLayerData(MAP * map, int x, int y) - { - return map->hexdata[x][y].layerData; - } - - void SetHexTerrain(MAP * map, int x, int y, char terrain) - { - map->hexdata[x][y].terrain = terrain; - } - - void SetHexElevation(MAP * map, int x, int y, char elevation) - { - map->hexdata[x][y].elevation = elevation; - } - - void SetHexLayers(MAP * map, int x, int y, int layers) - { - if (GetHexLayers(map, x, y) == layers) - return; - - map->hexdata[x][y].layers = validateLayers(map, x, y, layers); - } - - void SetHexLayerData(MAP * map, int x, int y, int layerData) - { - map->hexdata[x][y].layerData = layerData; - } --- 0 ---- Index: map.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/map.c,v retrieving revision 1.1.1.1.2.6 retrieving revision 1.1.1.1.2.7 diff -C2 -d -r1.1.1.1.2.6 -r1.1.1.1.2.7 *** map.c 30 Sep 2003 01:38:36 -0000 1.1.1.1.2.6 --- map.c 8 Aug 2004 23:48:16 -0000 1.1.1.1.2.7 *************** *** 235,239 **** int i1, i2, i3; FILE *fp; ! char row[MAPX * 2 + 2]; int i, j = 0, height, width, filemode; --- 235,239 ---- int i1, i2, i3; FILE *fp; ! char row[MAPX * 2 + 3]; int i, j = 0, height, width, filemode; *************** *** 265,269 **** for (i = 0; i < height; i++) { if (feof(fp) ! || fgets(row, 2 * MAPX + 1, fp) == NULL || strlen(row) < (2 * width)) { break; --- 265,269 ---- for (i = 0; i < height; i++) { if (feof(fp) ! || fgets(row, 2 * MAPX + 2, fp) == NULL || strlen(row) < (2 * width)) { break; Index: map.conditions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/map.conditions.c,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** map.conditions.c 18 Jul 2002 18:42:57 -0000 1.2.2.4 --- map.conditions.c 8 Aug 2004 23:48:16 -0000 1.2.2.5 *************** *** 170,174 **** int critType; int nhs = 0; - int z; int tDoAutoFall = 0; int tNormalizeAllCrits = 0; --- 170,173 ---- *************** *** 177,182 **** || hitloc == LARM) && (MechIsQuad(wounded)))); - MAP *map; - if (!(MechType(wounded) == CLASS_MECH || MechType(wounded) == CLASS_MW || MechType(wounded) == CLASS_BSUIT)) { --- 176,179 ---- Index: mech.advanced.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.advanced.c,v retrieving revision 1.3.2.6 retrieving revision 1.3.2.7 diff -C2 -d -r1.3.2.6 -r1.3.2.7 *** mech.advanced.c 30 Sep 2003 01:38:36 -0000 1.3.2.6 --- mech.advanced.c 8 Aug 2004 23:48:16 -0000 1.3.2.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; *************** *** 1762,1765 **** --- 1762,1769 ---- 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)) || *************** *** 1797,1800 **** --- 1801,1805 ---- ShowCoolMenu(player, c); KillCoolMenu(c); + target_mech = NULL; } else { int i; *************** *** 1816,1822 **** 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) --- 1821,1827 ---- 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.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** mech.ammodump.c 11 Dec 2002 00:44:59 -0000 1.1.1.1.2.1 --- mech.ammodump.c 8 Aug 2004 23:48:16 -0000 1.1.1.1.2.2 *************** *** 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.4.2.6 retrieving revision 1.4.2.7 diff -C2 -d -r1.4.2.6 -r1.4.2.7 *** mech.bth.c 17 Jul 2002 12:32:47 -0000 1.4.2.6 --- mech.bth.c 8 Aug 2004 23:48:16 -0000 1.4.2.7 *************** *** 623,627 **** float target_speed = 0.0; int returnValue = 0; - int i; float m = 1.0; MAP *map = FindObjectsData(target->mapindex); --- 623,626 ---- Index: mech.combat.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.combat.c,v retrieving revision 1.7.2.12 retrieving revision 1.7.2.13 diff -C2 -d -r1.7.2.12 -r1.7.2.13 *** mech.combat.c 30 Sep 2003 01:38:36 -0000 1.7.2.12 --- mech.combat.c 8 Aug 2004 23:48:16 -0000 1.7.2.13 *************** *** 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: Index: mech.combat.misc.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.combat.misc.c,v retrieving revision 1.5.2.3 retrieving revision 1.5.2.4 diff -C2 -d -r1.5.2.3 -r1.5.2.4 *** mech.combat.misc.c 30 Sep 2003 01:38:36 -0000 1.5.2.3 --- mech.combat.misc.c 8 Aug 2004 23:48:16 -0000 1.5.2.4 *************** *** 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.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.h,v retrieving revision 1.9.2.9 retrieving revision 1.9.2.10 diff -C2 -d -r1.9.2.9 -r1.9.2.10 *** mech.h 30 Sep 2003 01:38:36 -0000 1.9.2.9 --- mech.h 8 Aug 2004 23:48:16 -0000 1.9.2.10 *************** *** 1,3 **** --- 1,4 ---- + /* * $Id$ Index: mech.ice.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.ice.c,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** mech.ice.c 6 Dec 2002 14:28:42 -0000 1.2.2.4 --- mech.ice.c 8 Aug 2004 23:48:16 -0000 1.2.2.5 *************** *** 33,56 **** 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 (t != mech) { ! 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 || t == mech) ! 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); ! } ! } ! } } *************** *** 82,85 **** --- 85,95 ---- 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); + } } *************** *** 90,94 **** MarkForLOSUpdate(mech); ! mech_notify(mech, MECHALL, "You break thru the ice on your way up!"); MechLOSBroadcast(mech, "breaks through the ice!"); break_sub(map, mech, MechX(mech), MechY(mech), "goes swimming!"); --- 100,104 ---- MarkForLOSUpdate(mech); ! mech_notify(mech, MECHALL, "You break through the ice!"); MechLOSBroadcast(mech, "breaks through the ice!"); break_sub(map, mech, MechX(mech), MechY(mech), "goes swimming!"); Index: mech.maps.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.maps.c,v retrieving revision 1.7.2.8 retrieving revision 1.7.2.9 diff -C2 -d -r1.7.2.8 -r1.7.2.9 *** mech.maps.c 10 Dec 2002 14:21:03 -0000 1.7.2.8 --- mech.maps.c 8 Aug 2004 23:48:16 -0000 1.7.2.9 *************** *** 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) *************** *** 48,51 **** --- 49,92 ---- } + 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) { *************** *** 93,97 **** 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, ! NUM_COLOR_IDX }; --- 134,138 ---- 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, NUM_COLOR_IDX }; *************** *** 99,104 **** /* internal rep has H instead of h and \0 instead of n */ ! #define DEFAULT_COLOR_STRING "BbWnYyRWWWXGgbRhYRn" ! #define DEFAULT_COLOR_SCHEME "BbW\0YyRWWWXGgbRHYR\0" static char custom_color_str[NUM_COLOR_IDX + 1] = DEFAULT_COLOR_SCHEME; --- 140,145 ---- /* internal rep has H instead of h and \0 instead of n */ ! #define DEFAULT_COLOR_STRING "BbWnYyRWWWXGgbRhYRnGR" ! #define DEFAULT_COLOR_SCHEME "BbW\0YyRWWWXGgbRHYR\0GR" static char custom_color_str[NUM_COLOR_IDX + 1] = DEFAULT_COLOR_SCHEME; *************** *** 109,114 **** 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]) { --- 150,156 ---- 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]) { *************** *** 163,168 **** char mybuff[NAVIGATE_LINES][MBUF_SIZE]; MAP *mech_map; ! char **maptext; ! int i, dolos; cch(MECH_USUAL); --- 205,211 ---- char mybuff[NAVIGATE_LINES][MBUF_SIZE]; MAP *mech_map; ! char **maptext, *args[3]; ! int i, dolos, argc; ! short x, y; cch(MECH_USUAL); *************** *** 173,189 **** 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], --- 216,228 ---- 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], *************** *** 223,227 **** 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]); --- 262,266 ---- sprintf(mybuff[12], " 180"); ! navigate_sketch_mechs(mech, mech_map, x, y, mybuff); for (i = 0; i < NAVIGATE_LINES; i++) notify(player, mybuff[i]); *************** *** 381,386 **** char c = GetTerrain(map, x, y); ! int e = GetElev(map, x, y); ! char newc = TerrainColorChar(c, e); if (!c || !docolor || c == ' ') { --- 420,424 ---- char c = GetTerrain(map, x, y); ! char newc; if (!c || !docolor || c == ' ') { *************** *** 388,392 **** buf[1] = '\0'; return buf; ! } return add_color(newc, prevc, c); --- 426,449 ---- buf[1] = '\0'; return buf; ! } else ! newc = TerrainColorChar(c, GetElev(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 = GetElev(map, x, y); ! char c = (e || docolor) ? '0' + e : ' '; ! char newc; ! ! if (!docolor) { ! buf[0] = c; ! buf[1] = '\0'; ! return buf; ! } else ! newc = TerrainColorChar(GetTerrain(map, x, y), e); return add_color(newc, prevc, c); *************** *** 398,401 **** --- 455,459 ---- #define LRS_LOSMODE 8 #define LRS_COLORMODE 16 + #define LRS_ELEVCOLORMODE 32 static char *get_lrshexstr(MECH * mech, MAP *map, int x, int y, *************** *** 404,409 **** { int losflag = MAPLOSHEX_SEE | MAPLOSHEX_SEEN; - char c; - static char buf[5]; if (mode & LRS_MECHMODE) { --- 462,465 ---- *************** *** 429,443 **** return add_color(TerrainColorChar(UNKNOWN_TERRAIN, 0), prevc, '?'); ! if (mode & LRS_ELEVMODE) { ! c = GetElev(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); --- 485,490 ---- 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); *************** *** 570,574 **** } ! if (mode & LRS_COLORMODE) { if (prevct) { strcat(topbuff, "%cn"); --- 617,621 ---- } ! if (mode & (LRS_COLORMODE|LRS_ELEVCOLORMODE)) { if (prevct) { strcat(topbuff, "%cn"); *************** *** 589,598 **** { 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; --- 636,643 ---- { MECH *mech = (MECH *) data; MAP *map; ! int argc, mode = 0; short x, y; char *args[5], *str; int displayHeight = LRS_DISPLAY_HEIGHT; *************** *** 606,639 **** 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': --- 651,657 ---- 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': *************** *** 645,648 **** --- 663,670 ---- mode |= LRS_ELEVMODE; break; + case 'C': + case 'c': + mode |= LRS_ELEVMODE | LRS_ELEVCOLORMODE; + break; case 'T': case 't': *************** *** 1037,1040 **** --- 1059,1087 ---- } } + 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'; + } + } + } /* *************** *** 1098,1101 **** --- 1145,1156 ---- 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 = '?'; *************** *** 1206,1209 **** --- 1261,1265 ---- * 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 *************** *** 1347,1350 **** --- 1403,1413 ---- 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, *************** *** 1416,1427 **** 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; --- 1479,1485 ---- *************** *** 1455,1458 **** --- 1513,1520 ---- break; + case 'b': + flags |= 32; + break; + default: notify(player, "Invalid tactical map flag."); *************** *** 1463,1498 **** } ! 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) --- 1525,1533 ---- } ! 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.5.2.16 retrieving revision 1.5.2.17 diff -C2 -d -r1.5.2.16 -r1.5.2.17 *** mech.move.c 30 Sep 2003 01:38:36 -0000 1.5.2.16 --- mech.move.c 8 Aug 2004 23:48:16 -0000 1.5.2.17 *************** *** 488,491 **** --- 488,494 ---- MechLOSBroadcast(mech, "attempts to stand up."); + if (MechRTerrain(mech) == ICE && MechZ(mech) == -1) + break_thru_ice(mech); + if (tNeedsPSkill) { if (!MadePilotSkillRoll(mech, 0)) { *************** *** 860,864 **** int limbs = 4; int aLimbs[] = { RARM, LARM, LLEG, RLEG }; ! int i, j; int tempLoc; char locName[50]; --- 863,867 ---- int limbs = 4; int aLimbs[] = { RARM, LARM, LLEG, RLEG }; ! int i; int tempLoc; char locName[50]; *************** *** 927,931 **** continue; ! if (Jumping(target)) continue; --- 930,934 ---- continue; ! if (Jumping(target) || OODing(target)) continue; *************** *** 1590,1594 **** if (MechType(mech) != CLASS_MECH) continue; ! if (Jumping(mech)) continue; if (friendly < 0 || ((MechTeam(mech) == team) == friendly)) --- 1593,1597 ---- if (MechType(mech) != CLASS_MECH) continue; ! if (Jumping(mech) || OODing(mech)) continue; if (friendly < 0 || ((MechTeam(mech) == team) == friendly)) *************** *** 1657,1661 **** if (MechType(mech) != CLASS_MECH) continue; ! if (Jumping(mech)) continue; if (friendly < 0 || ((MechTeam(mech) == team) == friendly)) --- 1660,1664 ---- 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.3.2.12 retrieving revision 1.3.2.13 diff -C2 -d -r1.3.2.12 -r1.3.2.13 *** mech.notify.c 30 Sep 2003 01:38:36 -0000 1.3.2.12 --- mech.notify.c 8 Aug 2004 23:48:16 -0000 1.3.2.13 *************** *** 512,516 **** /* 1234567890123456 */ ! const char tempc[] = "xrgybmcwXRGYBMCW"; static char *ccode(MECH * m, int i) --- 512,516 ---- /* 1234567890123456 */ ! const char radio_colorstr[] = "xrgybmcwXRGYBMCW"; static char *ccode(MECH * m, int i) *************** *** 524,531 **** }; if (t < 9) { ! sprintf(buf, "%%c%c", tempc[t - 1]); return buf; } ! sprintf(buf, "%%ch%%c%c", ToLower(tempc[t - 1])); return buf; } --- 524,531 ---- }; 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; } *************** *** 585,594 **** 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; --- 585,594 ---- break; default: ! for (i = 0; radio_colorstr[i]; i++) ! if (*buffer == radio_colorstr[i]) { ... [truncated message content] |
From: Thomas W. <two...@us...> - 2004-08-08 23:48:53
|
Update of /cvsroot/btech/btechmux/src/hcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12777/src/hcode Modified Files: Tag: btmux_1_4-branch glue.c glue.hcode.c glue.scode.c Log Message: Annual (ahem) sync with the BitKeeper btechmux-stable tree (at btechmux.bkbits.net/btechmux-stable). 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: # -------------------------------------------- # 03/09/30 th...@st... 1.26 # 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/10/01 th...@st... 1.27 # 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.28.1.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.30 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/10/01 th...@ce... 1.31 # Ice glitchfixes: break through it while standing, and don't survive as tank breaking ice. # -------------------------------------------- # 03/10/01 th...@ce... 1.32 # More ice glitch fixes: properly break ice when picking a unit (but not a MechWarrior) up through it. # -------------------------------------------- # 03/10/01 th...@ce... 1.33 # Wups... don't sink hovertows. # -------------------------------------------- # 03/10/05 th...@st... 1.34 # Make MUX function 'btgetdbrefbyid' accept a map as well as a 'mech as its first argument. # -------------------------------------------- # 03/10/12 th...@st... 1.35 # - 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.36 # - Consider OOD-ing 'mechs as Jumping 'mechs where appropriate. # -------------------------------------------- # 03/10/14 th...@st... 1.37 # Add new 'c' option to LRS, for colorized terrain. # -------------------------------------------- # 03/10/14 th...@st... 1.38 # Don't cliff hovers that go from l0 bridge to l1 bridge. # -------------------------------------------- # 03/10/14 th...@st... 1.39 # Don't drown vehicles that manage to break l0 ice. # -------------------------------------------- # 03/10/15 th...@st... 1.40 # 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.41 # - Add 'tactical b', for displaying valid DropShip landing zones # - Add the ability to run 'checklz x y' for hexes in TacRange. # -------------------------------------------- # 03/10/19 th...@st... 1.42 # - 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.43 # 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.44 # Patch from Tony to make tel() and @tel 'teleport' exits the same way the 'drop' command does. # -------------------------------------------- # 03/10/21 th...@st... 1.45 # Fix eternal loop when calling btdamagemech() with a 'clustersize' of 0. # -------------------------------------------- # 03/10/31 th...@st... 1.46 # Glitchfix. # -------------------------------------------- # 03/10/31 th...@st... 1.47 # Possibly fix memory corruption problems 3030 has been having, by fixing around tprintf (as suggested by Null @ 3029.) # -------------------------------------------- # 03/11/14 th...@ce... 1.44.1.1 # Fix buglet in btlostohex(): use proper range. # -------------------------------------------- # 03/11/15 th...@st... 1.48 # Fix possibly malicious crashing bug in macros. # -------------------------------------------- # 03/11/15 th...@ce... 1.49 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/11/20 th...@st... 1.50 # Misc cleanup fixes. Stuff that probably didn't cause any real-world bugs, but should be fixed anyway. # -------------------------------------------- # 03/11/23 th...@st... 1.51 # - 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/09 th...@st... 1.52 # Fix off-by-one error in reading maps with an X size of MAPX (1000 by default.) # -------------------------------------------- # 04/02/10 th...@st... 1.53 # Open help/news files for reading, not writing. Oopsie from last changeset. # -------------------------------------------- # 04/02/12 th...@st... 1.54 # remove unused file. # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.1 # foobar changeset # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.2 # foobar2 # -------------------------------------------- # 04/05/08 th...@st... 1.55 # 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.56 # Protect some xcodevalues from being changed, to avoid memory corruption and the like. # -------------------------------------------- # 04/05/09 th...@st... 1.57 # 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.58 # Fix typo in previous checkin, and compile before checking in. # -------------------------------------------- # 04/05/11 th...@ce... 1.59 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 04/05/11 th...@ce... 1.60 # Fix compiler warnings: # - Add a few missing include files # - Remove unused variables # -------------------------------------------- # 04/05/11 th...@ce... 1.61 # 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.62 # Fix off-by-one error in the kick-decision range check in autopilots. # -------------------------------------------- # 04/07/29 th...@st... 1.63 # Attempt to improve the dieroll's randomness somewhat. # -------------------------------------------- Index: glue.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.c,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** glue.c 4 Apr 2002 13:13:08 -0000 1.5.2.2 --- glue.c 8 Aug 2004 23:48:13 -0000 1.5.2.3 *************** *** 178,182 **** } ! #define OkayHcode(a) (Hardcode(a) && !Zombie(a)) /* Main entry point */ --- 178,182 ---- } ! #define OkayHcode(a) (a >= 0 && Hardcode(a) && !Zombie(a)) /* Main entry point */ Index: glue.hcode.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.hcode.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** glue.hcode.c 3 Jan 2002 01:00:27 -0000 1.1.1.1 --- glue.hcode.c 8 Aug 2004 23:48:14 -0000 1.1.1.1.2.1 *************** *** 114,118 **** int silly_parseattributes(char *buffer, char **args, int max) { ! char bufferi[LBUF_SIZE], foobuff[LBUF_SIZE]; char *a, *b; int count = 0; --- 114,118 ---- int silly_parseattributes(char *buffer, char **args, int max) { ! static char bufferi[LBUF_SIZE], foobuff[LBUF_SIZE]; char *a, *b; int count = 0; *************** *** 153,157 **** args[max - 1] = foobuff; } ! return (num_args); } --- 153,157 ---- args[max - 1] = foobuff; } ! return num_args; } *************** *** 172,175 **** /* buffer */ } ! return (num_args); } --- 172,175 ---- /* buffer */ } ! return num_args; } Index: glue.scode.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.scode.c,v retrieving revision 1.2.2.15 retrieving revision 1.2.2.16 diff -C2 -d -r1.2.2.15 -r1.2.2.16 *** glue.scode.c 30 Sep 2003 01:38:35 -0000 1.2.2.15 --- glue.scode.c 8 Aug 2004 23:48:14 -0000 1.2.2.16 *************** *** 44,47 **** --- 44,48 ---- #include "p.event.h" #include "p.mech.restrict.h" + #include "mech.partnames.h" extern SpecialObjectStruct SpecialObjects[]; *************** *** 56,59 **** --- 57,61 ---- int rel_addr; int type; + int size; } GMV; *************** *** 68,77 **** enum { TYPE_STRING, TYPE_CHAR, TYPE_SHORT, TYPE_INT, TYPE_FLOAT, TYPE_DBREF, TYPE_STRFUNC, TYPE_STRFUNC_S, TYPE_BV, ! TYPE_STRFUNC_BD, TYPE_CBV }; /* INDENT OFF */ ! /* st ch sh in fl db sf sfs bv sfb cbv */ ! static int scode_in_out[] = { 3, 3, 3, 3, 3, 3, 1, 2, 3, 3, 3 }; /* INDENT ON */ --- 70,81 ---- enum { TYPE_STRING, TYPE_CHAR, TYPE_SHORT, TYPE_INT, TYPE_FLOAT, TYPE_DBREF, TYPE_STRFUNC, TYPE_STRFUNC_S, TYPE_BV, ! TYPE_STRFUNC_BD, TYPE_CBV, TYPE_CHAR_RO, TYPE_SHORT_RO, TYPE_INT_RO, ! TYPE_FLOAT_RO, TYPE_DBREF_RO, TYPE_LAST_TYPE }; /* INDENT OFF */ ! static int scode_in_out[TYPE_LAST_TYPE] = ! /* st ch sh in fl db sf sfs bv sfb cbv ro-ch ro-sh ro-in ro-fl ro-db*/ ! { 3, 3, 3, 3, 3, 3, 1, 2, 3, 3, 3, 1, 1, 1, 1, 1 }; /* INDENT ON */ *************** *** 81,112 **** #define MeEntry(Name,Func,Type) \ ! {GTYPE_MECH,Name,Uglie(Func),Type} #define MeVEntry(Name,Func,Val,Type) \ ! {GTYPE_MECH,Name,UglieV(Func,Val),Type} #define UglieM(dat) ((int) &tmpmap.dat) - ((int) &tmpmap) #define MaEntry(Name,Func,Type) \ ! {GTYPE_MAP,Name,UglieM(Func),Type} #define UglieT(dat) ((int) &tmpturret.dat) - ((int) &tmpturret) #define TuEntry(Name,Func,Type) \ ! {GTYPE_TURRET,Name,UglieT(Func),Type} #define UglieC(dat) ((int) &tmpcustom.dat) - ((int) &tmpcustom) #define CuEntry(Name,Func,Type) \ ! {GTYPE_CUSTOM,Name,UglieC(Func),Type} #define UglieScen(dat) ((int) &tmpscen.dat) - ((int) &tmpscen) #define SEntry(Name,Func,Type) \ ! {GTYPE_SCEN,Name,UglieScen(Func),Type} #define UglieSside(dat) ((int) &tmpsside.dat) - ((int) &tmpsside) #define SSEntry(Name,Func,Type) \ ! {GTYPE_SSIDE,Name,UglieSside(Func),Type} #define UglieSsobj(dat) ((int) &tmpssobj.dat) - ((int) &tmpssobj) #define SSOEntry(Name,Func,Type) \ ! {GTYPE_SSOBJ,Name,UglieSsobj(Func),Type} --- 85,131 ---- #define MeEntry(Name,Func,Type) \ ! {GTYPE_MECH,Name,Uglie(Func),Type,0} ! ! #define MeEntryS(Name,Func,Type,Size) \ ! {GTYPE_MECH,Name,Uglie(Func),Type,Size} #define MeVEntry(Name,Func,Val,Type) \ ! {GTYPE_MECH,Name,UglieV(Func,Val),Type,0} #define UglieM(dat) ((int) &tmpmap.dat) - ((int) &tmpmap) #define MaEntry(Name,Func,Type) \ ! {GTYPE_MAP,Name,UglieM(Func),Type,0} ! #define MaEntryS(Name,Func,Type,Size) \ ! {GTYPE_MAP,Name,UglieM(Func),Type,Size} #define UglieT(dat) ((int) &tmpturret.dat) - ((int) &tmpturret) #define TuEntry(Name,Func,Type) \ ! {GTYPE_TURRET,Name,UglieT(Func),Type,0} ! #define TuEntryS(Name,Func,Type,Size) \ ! {GTYPE_TURRET,Name,UglieT(Func),Type,Size} #define UglieC(dat) ((int) &tmpcustom.dat) - ((int) &tmpcustom) #define CuEntry(Name,Func,Type) \ ! {GTYPE_CUSTOM,Name,UglieC(Func),Type,0} ! #define CuEntryS(Name,Func,Type,Size) \ ! {GTYPE_CUSTOM,Name,UglieC(Func),Type,Size} #define UglieScen(dat) ((int) &tmpscen.dat) - ((int) &tmpscen) #define SEntry(Name,Func,Type) \ ! {GTYPE_SCEN,Name,UglieScen(Func),Type,0} ! #define SEntryS(Name,Func,Type,Size) \ ! {GTYPE_SCEN,Name,UglieScen(Func),Type,Size} #define UglieSside(dat) ((int) &tmpsside.dat) - ((int) &tmpsside) #define SSEntry(Name,Func,Type) \ ! {GTYPE_SSIDE,Name,UglieSside(Func),Type,0} ! #define SSEntryS(Name,Func,Type,Size) \ ! {GTYPE_SSIDE,Name,UglieSside(Func),Type,Size} #define UglieSsobj(dat) ((int) &tmpssobj.dat) - ((int) &tmpssobj) #define SSOEntry(Name,Func,Type) \ ! {GTYPE_SSOBJ,Name,UglieSsobj(Func),Type,0} ! #define SSOEntryS(Name,Func,Type,Size) \ ! {GTYPE_SSOBJ,Name,UglieSsobj(Func),Type,Size} *************** *** 420,427 **** {GTYPE_MECH, "mapindex", ((int) &tmpm.mapindex) - ((int) &tmpm), ! TYPE_DBREF}, {GTYPE_MECH, "id", (int) mechIDfunc, TYPE_STRFUNC}, ! MeEntry("mechname", MechType_Name, TYPE_STRING), MeEntry("maxspeed", MechMaxSpeed, TYPE_FLOAT), MeEntry("pilotnum", MechPilot, TYPE_DBREF), --- 439,446 ---- {GTYPE_MECH, "mapindex", ((int) &tmpm.mapindex) - ((int) &tmpm), ! TYPE_DBREF_RO}, {GTYPE_MECH, "id", (int) mechIDfunc, TYPE_STRFUNC}, ! MeEntryS("mechname", MechType_Name, TYPE_STRING, 31), MeEntry("maxspeed", MechMaxSpeed, TYPE_FLOAT), MeEntry("pilotnum", MechPilot, TYPE_DBREF), *************** *** 441,454 **** MeEntry("team", MechTeam, TYPE_INT), MeEntry("tons", MechTons, TYPE_INT), ! MeEntry("towing", MechCarrying, TYPE_INT), MeEntry("heat", MechPlusHeat, TYPE_FLOAT), ! MeEntry("disabled_hs", MechDisabledHS, TYPE_INT), MeEntry("overheat", MechHeat, TYPE_FLOAT), MeEntry("dissheat", MechMinusHeat, TYPE_FLOAT), MeEntry("last_startup", MechLastStartup, TYPE_INT), ! MeEntry("C3iNetworkSize", MechC3iNetworkSize, TYPE_INT), MeEntry("MaxSuits", MechMaxSuits, TYPE_INT), MeEntry("realweight", MechRTonsV, TYPE_INT), ! MeEntry("StaggerDamage", StaggerDamage, TYPE_INT), #ifdef BT_ENABLED --- 460,474 ---- MeEntry("team", MechTeam, TYPE_INT), MeEntry("tons", MechTons, TYPE_INT), ! MeEntry("towing", MechCarrying, TYPE_INT_RO), MeEntry("heat", MechPlusHeat, TYPE_FLOAT), ! MeEntry("disabled_hs", MechDisabledHS, TYPE_INT_RO), MeEntry("overheat", MechHeat, TYPE_FLOAT), MeEntry("dissheat", MechMinusHeat, TYPE_FLOAT), MeEntry("last_startup", MechLastStartup, TYPE_INT), ! MeEntry("C3iNetworkSize", MechC3iNetworkSize, TYPE_INT_RO), MeEntry("MaxSuits", MechMaxSuits, TYPE_INT), MeEntry("realweight", MechRTonsV, TYPE_INT), ! MeEntry("StaggerDamage", StaggerDamage, TYPE_INT_RO), ! MeEntry("MechPrefs", MechPrefs, TYPE_BV), #ifdef BT_ENABLED *************** *** 465,469 **** MeEntry("fuel", AeroFuel, TYPE_INT), MeEntry("fuel_orig", AeroFuelOrig, TYPE_INT), ! MeEntry("cocoon", MechCocoon, TYPE_INT), MeEntry("numseen", MechNumSeen, TYPE_SHORT), --- 485,489 ---- MeEntry("fuel", AeroFuel, TYPE_INT), MeEntry("fuel_orig", AeroFuelOrig, TYPE_INT), ! MeEntry("cocoon", MechCocoon, TYPE_INT_RO), MeEntry("numseen", MechNumSeen, TYPE_SHORT), *************** *** 492,496 **** MeVEntry("turret2", AeroTurret, 2, TYPE_DBREF), ! MeEntry("unusablearcs", AeroUnusableArcs, TYPE_INT), MeEntry("maxjumpspeed", MechJumpSpeed, TYPE_FLOAT), MeEntry("jumpheading", MechJumpHeading, TYPE_SHORT), --- 512,516 ---- MeVEntry("turret2", AeroTurret, 2, TYPE_DBREF), ! MeEntry("unusablearcs", AeroUnusableArcs, TYPE_INT_RO), MeEntry("maxjumpspeed", MechJumpSpeed, TYPE_FLOAT), MeEntry("jumpheading", MechJumpHeading, TYPE_SHORT), *************** *** 498,512 **** MaEntry("buildflag", buildflag, TYPE_CHAR), ! MaEntry("buildonmap", onmap, TYPE_DBREF), MaEntry("cf", cf, TYPE_SHORT), MaEntry("cfmax", cfmax, TYPE_SHORT), MaEntry("gravity", grav, TYPE_CHAR), MaEntry("maxcf", cfmax, TYPE_SHORT), ! MaEntry("firstfree", first_free, TYPE_CHAR), ! MaEntry("mapheight", map_height, TYPE_SHORT), MaEntry("maplight", maplight, TYPE_CHAR), ! MaEntry("mapname", mapname, TYPE_STRING), MaEntry("mapvis", mapvis, TYPE_CHAR), ! MaEntry("mapwidth", map_width, TYPE_SHORT), MaEntry("maxvis", maxvis, TYPE_SHORT), MaEntry("temperature", temp, TYPE_CHAR), --- 518,532 ---- MaEntry("buildflag", buildflag, TYPE_CHAR), ! MaEntry("buildonmap", onmap, TYPE_DBREF_RO), MaEntry("cf", cf, TYPE_SHORT), MaEntry("cfmax", cfmax, TYPE_SHORT), MaEntry("gravity", grav, TYPE_CHAR), MaEntry("maxcf", cfmax, TYPE_SHORT), ! MaEntry("firstfree", first_free, TYPE_CHAR_RO), ! MaEntry("mapheight", map_height, TYPE_SHORT_RO), MaEntry("maplight", maplight, TYPE_CHAR), ! MaEntryS("mapname", mapname, TYPE_STRING, 30), MaEntry("mapvis", mapvis, TYPE_CHAR), ! MaEntry("mapwidth", map_width, TYPE_SHORT_RO), MaEntry("maxvis", maxvis, TYPE_SHORT), MaEntry("temperature", temp, TYPE_CHAR), *************** *** 535,539 **** SEntry("end", end_t, TYPE_INT), ! SSEntry("slet", slet, TYPE_STRING), SSOEntry("state", state, TYPE_INT), --- 555,559 ---- SEntry("end", end_t, TYPE_INT), ! SSEntryS("slet", slet, TYPE_STRING, 10), SSOEntry("state", state, TYPE_INT), *************** *** 574,578 **** break; case TYPE_STRING: ! strcpy((char *) bar, fargs[2]); break; case TYPE_DBREF: --- 594,599 ---- break; case TYPE_STRING: ! strncpy((char *) bar, fargs[2], xcode_data[i].size - 1); ! ((char *)bar)[xcode_data[i].size - 1] = '\0'; break; case TYPE_DBREF: *************** *** 621,636 **** --- 642,662 ---- break; case TYPE_DBREF: + case TYPE_DBREF_RO: sprintf(buf, "%d", (dbref) * ((dbref *) bar)); break; case TYPE_CHAR: + case TYPE_CHAR_RO: sprintf(buf, "%d", (char) *((char *) bar)); break; case TYPE_SHORT: + case TYPE_SHORT_RO: sprintf(buf, "%d", (short) *((short *) bar)); break; case TYPE_INT: + case TYPE_INT_RO: sprintf(buf, "%d", (int) *((int *) bar)); break; case TYPE_FLOAT: + case TYPE_FLOAT_RO: sprintf(buf, "%.2f", (float) *((float *) bar)); break; *************** *** 729,733 **** break; case TYPE_STRING: ! strcpy((char *) bar, args[1]); break; case TYPE_DBREF: --- 755,760 ---- break; case TYPE_STRING: ! strncpy((char *) bar, args[1], xcode_data[i].size - 1); ! ((char *)bar)[xcode_data[i].size - 1] = '\0'; break; case TYPE_DBREF: *************** *** 822,845 **** FUNCTION(fun_btstores) { ! /* fargs[0] = id of the bay */ ! /* fargs[1] = name of the part */ dbref it; ! int i, spec; ! void *foo; int p, b; - it = match_thing(player, fargs[0]); - FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); - spec = WhichSpecial(it); - FUNCHECK(!(foo = FindObjectsData(it)), "#-1"); FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); ! i = -1; ! if (!find_matching_long_part(fargs[1], &i, &p, &b)) { i = -1; ! FUNCHECK(!find_matching_vlong_part(fargs[1], &i, &p, &b), ! "#-1 INVALID PART NAME"); } - safe_tprintf_str(buff, bufc, "%d", econ_find_items(it, p, b)); - return; } --- 849,893 ---- FUNCTION(fun_btstores) { ! /* fargs[0] = id of the bay/mech */ ! /* fargs[1] = (optional) name of the part */ dbref it; ! int i, x = 0; int p, b; + int pile[BRANDCOUNT + 1][NUM_ITEMS]; + char *t; FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); ! FUNCHECK(nfargs < 1 || nfargs > 2, ! "#-1 FUNCTION (BTSTORES) EXPECTS 1 OR 2 ARGUMENTS"); ! it = match_thing(player, fargs[0]); ! FUNCHECK(!Good_obj(it), "#-1 INVALID TARGET"); ! if (nfargs > 1) { i = -1; ! if (!find_matching_long_part(fargs[1], &i, &p, &b)) { ! i = -1; ! FUNCHECK(!find_matching_vlong_part(fargs[1], &i, &p, &b), ! "#-1 INVALID PART NAME"); ! } ! safe_tprintf_str(buff, bufc, "%d", econ_find_items(it, p, b)); ! } else { ! memset(pile, 0, sizeof(pile)); ! t = silly_atr_get(it, A_ECONPARTS); ! while (*t) { ! if (*t == '[') ! if ((sscanf(t, "[%d,%d,%d]", &i, &p, &b)) == 3) ! pile[p][i] += b; ! t++; ! } ! for (i = 0; i < object_count; i++) { ! UNPACK_PART(short_sorted[i]->index, p, b); ! if (pile[b][p]) { ! if (x) ! safe_str("|", buff, bufc); ! x = pile[b][p]; ! safe_tprintf_str(buff, bufc, "%s:%d", ! part_name_long(p, b), x); ! } ! } } } *************** *** 1089,1094 **** FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); FUNCHECK(!(mech = FindObjectsData(it)), "#-1 UNABLE TO GET MECHDATA"); ! FUNCHECK(Readnum(totaldam, fargs[1]), "#-1 INVALID 2ND ARG"); ! FUNCHECK(Readnum(clustersize, fargs[2]), "#-1 INVALID 3RD ARG"); FUNCHECK(Readnum(direction, fargs[3]), "#-1 INVALID 4TH ARG"); FUNCHECK(Readnum(iscrit, fargs[4]), "#-1 INVALID 5TH ARG"); --- 1137,1144 ---- FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); FUNCHECK(!(mech = FindObjectsData(it)), "#-1 UNABLE TO GET MECHDATA"); ! FUNCHECK(Readnum(totaldam, fargs[1]) || totaldam < 1, ! "#-1 INVALID 2ND ARG"); ! FUNCHECK(Readnum(clustersize, fargs[2]) || clustersize < 1, ! "#-1 INVALID 3RD ARG"); FUNCHECK(Readnum(direction, fargs[3]), "#-1 INVALID 4TH ARG"); FUNCHECK(Readnum(iscrit, fargs[4]), "#-1 INVALID 5TH ARG"); *************** *** 1207,1212 **** /* fargs[0] = mech fargs[1] = target ID */ - MECH *mech; MECH *target; dbref mechnum; --- 1257,1262 ---- /* fargs[0] = mech fargs[1] = target ID */ MECH *target; + MECH *mech = NULL; dbref mechnum; *************** *** 1214,1227 **** mechnum = match_thing(player, fargs[0]); FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), ! "#-1 INVALID MECH"); ! FUNCHECK(!IsMech(mechnum), "#-1 INVALID MECH"); ! FUNCHECK(!(mech = getMech(mechnum)), "#-1 INVALID MECH"); FUNCHECK(strlen(fargs[1]) != 2, "#-1 INVALID TARGETID"); ! mechnum = FindTargetDBREFFromMapNumber(mech, fargs[1]); FUNCHECK(mechnum < 0, "#-1 INVALID TARGETID"); ! FUNCHECK(!(target = getMech(mechnum)), "#-1 INVALID TARGETID"); ! FUNCHECK(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), ! FlMechRange(getMap(mech->mapindex), mech, target)), ! "#-1 INVALID TARGETID"); safe_tprintf_str(buff, bufc, "#%d", (int) mechnum); } --- 1264,1287 ---- mechnum = match_thing(player, fargs[0]); FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), ! "#-1 INVALID MECH/MAP"); FUNCHECK(strlen(fargs[1]) != 2, "#-1 INVALID TARGETID"); ! if (IsMech(mechnum)) { ! FUNCHECK(!(mech = getMech(mechnum)), "#-1 INVALID MECH"); ! mechnum = FindTargetDBREFFromMapNumber(mech, fargs[1]); ! } else if (IsMap(mechnum)) { ! MAP *map; ! FUNCHECK(!(map = getMap(mechnum)), "#-1 INVALID MAP"); ! mechnum = FindMechOnMap(map, fargs[1]); ! } else { ! safe_str("#-1 INVALID MECH/MAP", buff, bufc); ! return; ! } FUNCHECK(mechnum < 0, "#-1 INVALID TARGETID"); ! if (mech) { ! FUNCHECK(!(target = getMech(mechnum)), "#-1 INVALID TARGETID"); ! FUNCHECK(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), ! FlMechRange(getMap(mech->mapindex), mech, target)), ! "#-1 INVALID TARGETID"); ! } safe_tprintf_str(buff, bufc, "#%d", (int) mechnum); } *************** *** 1237,1240 **** --- 1297,1301 ---- MAP *map; int x = -1, y = -1, mechnum; + float fx, fy; FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); *************** *** 1250,1255 **** FUNCHECK(x < 0 || x > map->map_width || y < 0 || y > map->map_height, "#-1 INVALID COORDINATES"); if (InLineOfSight_NB(mech, NULL, x, y, ! FindHexRange(MechFX(mech), MechFY(mech), x, y))) safe_tprintf_str(buff, bufc, "1"); else --- 1311,1317 ---- FUNCHECK(x < 0 || x > map->map_width || y < 0 || y > map->map_height, "#-1 INVALID COORDINATES"); + MapCoordToRealCoord(x, y, &fx, &fy); if (InLineOfSight_NB(mech, NULL, x, y, ! FindHexRange(MechFX(mech), MechFY(mech), fx, fy))) safe_tprintf_str(buff, bufc, "1"); else *************** *** 1305,1309 **** !find_matching_vlong_part(fargs[1], &index, &id, &brand) && !find_matching_long_part(fargs[1], &index, &id, &brand), "0"); - found: econ_change_items(loc, id, brand, count); SendEcon(tprintf("#%d added %d %s to #%d", player, count, --- 1367,1370 ---- *************** *** 1369,1372 **** } } ! #endif --- 1430,1464 ---- } } ! ! extern char radio_colorstr[]; ! ! FUNCTION(fun_btmechfreqs) ! { ! /* fargs[0] = mechobject ! */ ! int mechdbref; ! MECH * mech; ! int i; ! ! FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); ! mechdbref = match_thing(player, fargs[0]); ! FUNCHECK(!Good_obj(mechdbref), "#-1 INVALID TARGET"); ! mech = getMech(mechdbref); ! FUNCHECK(!mech, "#-1 INVALID TARGET"); ! ! for (i = 0; i < MFreqs(mech); i++) { ! if (i) ! safe_str(",", buff, bufc); ! safe_tprintf_str(buff, bufc, "%d|%d|%s", ! i + 1, mech->freq[i], ! bv2text(mech->freqmodes[i] % FREQ_REST)); ! if (mech->freqmodes[i] / FREQ_REST) { ! safe_tprintf_str(buff, bufc, "|%c", ! radio_colorstr[mech->freqmodes[i] / FREQ_REST - 1]); ! } else { ! safe_str("|-", buff, bufc); ! } ! } ! } ! #endif |
From: Thomas W. <two...@us...> - 2004-08-08 23:48:53
|
Update of /cvsroot/btech/btechmux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12777/src Modified Files: Tag: btmux_1_4-branch bsd.c comsys.c db.c db.h eval.c file_c.c functions.c game.c help.c macro.c mail.c p.db.h p.sa-db.h predicates.c wiz.c Log Message: Annual (ahem) sync with the BitKeeper btechmux-stable tree (at btechmux.bkbits.net/btechmux-stable). 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: # -------------------------------------------- # 03/09/30 th...@st... 1.26 # 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/10/01 th...@st... 1.27 # 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.28.1.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.30 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/10/01 th...@ce... 1.31 # Ice glitchfixes: break through it while standing, and don't survive as tank breaking ice. # -------------------------------------------- # 03/10/01 th...@ce... 1.32 # More ice glitch fixes: properly break ice when picking a unit (but not a MechWarrior) up through it. # -------------------------------------------- # 03/10/01 th...@ce... 1.33 # Wups... don't sink hovertows. # -------------------------------------------- # 03/10/05 th...@st... 1.34 # Make MUX function 'btgetdbrefbyid' accept a map as well as a 'mech as its first argument. # -------------------------------------------- # 03/10/12 th...@st... 1.35 # - 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.36 # - Consider OOD-ing 'mechs as Jumping 'mechs where appropriate. # -------------------------------------------- # 03/10/14 th...@st... 1.37 # Add new 'c' option to LRS, for colorized terrain. # -------------------------------------------- # 03/10/14 th...@st... 1.38 # Don't cliff hovers that go from l0 bridge to l1 bridge. # -------------------------------------------- # 03/10/14 th...@st... 1.39 # Don't drown vehicles that manage to break l0 ice. # -------------------------------------------- # 03/10/15 th...@st... 1.40 # 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.41 # - Add 'tactical b', for displaying valid DropShip landing zones # - Add the ability to run 'checklz x y' for hexes in TacRange. # -------------------------------------------- # 03/10/19 th...@st... 1.42 # - 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.43 # 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.44 # Patch from Tony to make tel() and @tel 'teleport' exits the same way the 'drop' command does. # -------------------------------------------- # 03/10/21 th...@st... 1.45 # Fix eternal loop when calling btdamagemech() with a 'clustersize' of 0. # -------------------------------------------- # 03/10/31 th...@st... 1.46 # Glitchfix. # -------------------------------------------- # 03/10/31 th...@st... 1.47 # Possibly fix memory corruption problems 3030 has been having, by fixing around tprintf (as suggested by Null @ 3029.) # -------------------------------------------- # 03/11/14 th...@ce... 1.44.1.1 # Fix buglet in btlostohex(): use proper range. # -------------------------------------------- # 03/11/15 th...@st... 1.48 # Fix possibly malicious crashing bug in macros. # -------------------------------------------- # 03/11/15 th...@ce... 1.49 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/11/20 th...@st... 1.50 # Misc cleanup fixes. Stuff that probably didn't cause any real-world bugs, but should be fixed anyway. # -------------------------------------------- # 03/11/23 th...@st... 1.51 # - 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/09 th...@st... 1.52 # Fix off-by-one error in reading maps with an X size of MAPX (1000 by default.) # -------------------------------------------- # 04/02/10 th...@st... 1.53 # Open help/news files for reading, not writing. Oopsie from last changeset. # -------------------------------------------- # 04/02/12 th...@st... 1.54 # remove unused file. # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.1 # foobar changeset # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.2 # foobar2 # -------------------------------------------- # 04/05/08 th...@st... 1.55 # 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.56 # Protect some xcodevalues from being changed, to avoid memory corruption and the like. # -------------------------------------------- # 04/05/09 th...@st... 1.57 # 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.58 # Fix typo in previous checkin, and compile before checking in. # -------------------------------------------- # 04/05/11 th...@ce... 1.59 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 04/05/11 th...@ce... 1.60 # Fix compiler warnings: # - Add a few missing include files # - Remove unused variables # -------------------------------------------- # 04/05/11 th...@ce... 1.61 # 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.62 # Fix off-by-one error in the kick-decision range check in autopilots. # -------------------------------------------- # 04/07/29 th...@st... 1.63 # Attempt to improve the dieroll's randomness somewhat. # -------------------------------------------- Index: bsd.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/bsd.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** bsd.c 23 Jan 2002 21:20:24 -0000 1.3 --- bsd.c 8 Aug 2004 23:48:11 -0000 1.3.2.1 *************** *** 1213,1217 **** #ifdef HAVE_UNION_WAIT ! union wait stat; #else --- 1213,1217 ---- #ifdef HAVE_UNION_WAIT ! union wait stat = {0}; #else Index: comsys.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/comsys.c,v retrieving revision 1.6.2.5 retrieving revision 1.6.2.6 diff -C2 -d -r1.6.2.5 -r1.6.2.6 *** comsys.c 8 Aug 2002 23:08:28 -0000 1.6.2.5 --- comsys.c 8 Aug 2004 23:48:11 -0000 1.6.2.6 *************** *** 1726,1730 **** { struct channel *ch; - struct comuser *user; static char smbuf[SBUF_SIZE]; --- 1726,1729 ---- Index: db.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/db.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** db.c 23 Jan 2002 21:20:24 -0000 1.4 --- db.c 8 Aug 2004 23:48:11 -0000 1.4.2.1 *************** *** 91,242 **** /* - * --------------------------------------------------------------------------- - * * Temp file management, used to get around static limits in some versions - * * of libc. - */ - - FILE *t_fd; - int t_is_pipe; - - #ifdef TLI - int t_is_tli; - - #endif - - static void tf_xclose(fd) - FILE *fd; - { - if (fd) { - if (t_is_pipe) - pclose(fd); - #ifdef TLI - else if (t_is_tli) - t_close(fd); - #endif - else - fclose(fd); - } else { - close(0); - } - t_fd = NULL; - t_is_pipe = 0; - } - - static int tf_fiddle(tfd) - int tfd; - { - if (tfd < 0) { - tfd = open(DEV_NULL, O_RDONLY, 0); - return -1; - } - if (tfd != 0) { - dup2(tfd, 0); - close(tfd); - } - return 0; - } - - static int tf_xopen(fname, mode) - char *fname; - int mode; - { - int fd; - - fd = open(fname, mode, 0600); - fd = tf_fiddle(fd); - return fd; - } - - /* - * #define t_xopen(f,m) t_fiddle(open(f, m, 0600)) - */ - - static const char *mode_txt(mode) - int mode; - { - switch (mode & O_ACCMODE) { - case O_RDONLY: - return "r"; - case O_WRONLY: - return "w"; - } - return "r+"; - } - - void NDECL(tf_init) - { - fclose(stdin); - tf_xopen(DEV_NULL, O_RDONLY); - t_fd = NULL; - t_is_pipe = 0; - } - - int tf_open(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - return tf_xopen(fname, mode); - } - - #ifndef STANDALONE - - int tf_socket(fam, typ) - int fam, typ; - { - tf_xclose(t_fd); - return tf_fiddle(socket(fam, typ, 0)); - } - - #ifdef TLI - int tf_topen(fam, mode) - int fam, mode; - { - tf_xclose(t_fd); - return tf_fiddle(t_open(fam, mode, NULL)); - } - - #endif - #endif - - void tf_close(fdes) - int fdes; - { - tf_xclose(t_fd); - tf_xopen(DEV_NULL, O_RDONLY); - } - - FILE *tf_fopen(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - if (tf_xopen(fname, mode) >= 0) { - t_fd = fdopen(0, mode_txt(mode)); - return t_fd; - } - return NULL; - } - - void tf_fclose(fd) - FILE *fd; - { - tf_xclose(t_fd); - tf_xopen(DEV_NULL, O_RDONLY); - } - - FILE *tf_popen(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - t_fd = popen(fname, mode_txt(mode)); - if (t_fd != NULL) { - t_is_pipe = 1; - } - return t_fd; - } - - /* * #define GNU_MALLOC_TEST 1 */ --- 91,94 ---- *************** *** 2715,2718 **** --- 2567,2572 ---- s_Owner(thing, GOD); s_Flags(thing, (TYPE_GARBAGE | GOING)); + s_Flags2(thing, 0); + s_Flags3(thing, 0); s_Powers(thing, 0); s_Powers2(thing, 0); Index: db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/db.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** db.h 3 Jan 2002 00:59:28 -0000 1.1.1.1 --- db.h 8 Aug 2004 23:48:11 -0000 1.1.1.1.2.1 *************** *** 231,244 **** extern void FDECL(s_Pennies, (dbref, int)); - extern void NDECL(tf_init); - extern int FDECL(tf_open, (char *, int)); - extern int FDECL(tf_socket, (int, int)); - extern void FDECL(tf_close, (int)); - extern FILE *FDECL(tf_fopen, (char *, int)); - extern void FDECL(tf_fclose, (FILE *)); - extern FILE *FDECL(tf_popen, (char *, int)); - - #define tf_pclose(f) tf_fclose(f) - extern dbref FDECL(getref, (FILE *)); extern void FDECL(putref, (FILE *, dbref)); --- 231,234 ---- Index: eval.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/eval.c,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** eval.c 30 Jul 2002 20:29:48 -0000 1.2.2.1 --- eval.c 8 Aug 2004 23:48:11 -0000 1.2.2.2 *************** *** 183,187 **** break; case '[': ! if (cstr[-1] == ESC_CHAR) { first = 0; break; --- 183,187 ---- break; case '[': ! if (cstr != rstr && cstr[-1] == ESC_CHAR) { first = 0; break; Index: file_c.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/file_c.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** file_c.c 3 Jan 2002 00:59:54 -0000 1.1.1.1 --- file_c.c 8 Aug 2004 23:48:11 -0000 1.1.1.1.2.1 *************** *** 136,140 **** */ ! if ((fd = tf_open(filename, O_RDONLY)) == -1) { /* --- 136,140 ---- */ ! if ((fd = open(filename, O_RDONLY)) == -1) { /* *************** *** 149,153 **** ENDLOG; } - tf_close(fd); return -1; --- 149,152 ---- *************** *** 189,193 **** } free_lbuf(buff); ! tf_close(fd); /* --- 188,192 ---- } free_lbuf(buff); ! close(fd); /* Index: functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/functions.c,v retrieving revision 1.5.2.10 retrieving revision 1.5.2.11 diff -C2 -d -r1.5.2.10 -r1.5.2.11 *** functions.c 30 Sep 2003 01:38:35 -0000 1.5.2.10 --- functions.c 8 Aug 2004 23:48:11 -0000 1.5.2.11 *************** *** 79,82 **** --- 79,83 ---- XFUNCTION(fun_btloadmap) XFUNCTION(fun_btloadmech) + XFUNCTION(fun_btmechfreqs) XFUNCTION(fun_cwho); XFUNCTION(fun_clist); *************** *** 2254,2258 **** FUNCTION(fun_mul) { ! int i, got_one; double prod; --- 2255,2259 ---- FUNCTION(fun_mul) { ! int i; double prod; *************** *** 5107,5111 **** {"BTMAKEPILOTROLL", fun_btmakepilotroll, 3, 0, CA_WIZARD}, {"BTSETXCODEVALUE", fun_btsetxcodevalue, 3, 0, CA_WIZARD}, ! {"BTSTORES", fun_btstores, 2, 0, CA_WIZARD}, {"BTDAMAGES", fun_btdamages, 1, 0, CA_WIZARD}, {"BTCRITSTATUS",fun_btcritstatus,2,0, CA_WIZARD}, --- 5108,5112 ---- {"BTMAKEPILOTROLL", fun_btmakepilotroll, 3, 0, CA_WIZARD}, {"BTSETXCODEVALUE", fun_btsetxcodevalue, 3, 0, CA_WIZARD}, ! {"BTSTORES", fun_btstores, 0, FN_VARARGS, CA_WIZARD}, {"BTDAMAGES", fun_btdamages, 1, 0, CA_WIZARD}, {"BTCRITSTATUS",fun_btcritstatus,2,0, CA_WIZARD}, *************** *** 5129,5132 **** --- 5130,5134 ---- {"BTLOADMAP", fun_btloadmap, 2, FN_VARARGS, CA_WIZARD}, {"BTLOADMECH", fun_btloadmech, 2, 0, CA_WIZARD}, + {"BTMECHFREQS", fun_btmechfreqs, 1, 0, CA_WIZARD}, #endif {"CAPSTR", fun_capstr, -1, 0, CA_PUBLIC}, Index: game.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/game.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** game.c 28 Jan 2002 19:55:22 -0000 1.3 --- game.c 8 Aug 2004 23:48:11 -0000 1.3.2.1 *************** *** 884,888 **** char *message; { ! int fd; ResetSpecialObjects(); --- 884,888 ---- char *message; { ! FILE * fs; ResetSpecialObjects(); *************** *** 904,912 **** log_text(message); ENDLOG; ! } fd = tf_open(mudconf.status_file, O_RDWR | O_CREAT | O_TRUNC); ! (void) write(fd, message, strlen(message)); ! (void) write(fd, (char *) "\n", 1); ! tf_close(fd); /* --- 904,912 ---- log_text(message); ENDLOG; ! } ! fs = fopen(mudconf.status_file, "w"); ! fprintf(fs, "%s\n", message); ! fclose(fs); /* *************** *** 962,969 **** if (dump_type == DUMP_CRASHED) { unlink(mudconf.crashdb); ! f = tf_fopen(mudconf.crashdb, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening crash file", --- 962,969 ---- if (dump_type == DUMP_CRASHED) { unlink(mudconf.crashdb); ! f = fopen(mudconf.crashdb, "w"); if (f != NULL) { db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening crash file", *************** *** 982,990 **** if (dump_type == DUMP_RESTART) { ! f = tf_fopen(mudconf.indb, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening restart file", --- 982,990 ---- if (dump_type == DUMP_RESTART) { ! f = fopen(mudconf.indb, "w"); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening restart file", *************** *** 1004,1012 **** if (dump_type == DUMP_KILLED) { sprintf(tmpfile, "%s.KILLED", mudconf.indb); ! f = tf_fopen(tmpfile, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening killed file", mudconf.indb); --- 1004,1012 ---- if (dump_type == DUMP_KILLED) { sprintf(tmpfile, "%s.KILLED", mudconf.indb); ! f = fopen(tmpfile, "w"); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening killed file", mudconf.indb); *************** *** 1044,1052 **** StringCopy(outfn, mudconf.outdb); strcat(outfn, ".gz"); ! f = tf_popen(tprintf("%s > %s", mudconf.compress, tmpfile), ! O_WRONLY); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! tf_pclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, outfn) < 0) --- 1044,1051 ---- StringCopy(outfn, mudconf.outdb); strcat(outfn, ".gz"); ! f = popen(tprintf("%s > %s", mudconf.compress, tmpfile), "w"); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! pclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, outfn) < 0) *************** *** 1060,1067 **** * VMS */ ! f = tf_fopen(tmpfile, O_WRONLY | O_CREAT | O_TRUNC); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! tf_fclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, mudconf.outdb) < 0) --- 1059,1066 ---- * VMS */ ! f = fopen(tmpfile, "w"); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! fclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, mudconf.outdb) < 0) *************** *** 1212,1217 **** strcat(infile, ".gz"); if (stat(infile, &statbuf) == 0) { ! if ((f = tf_popen(tprintf(" %s < %s", mudconf.uncompress, ! infile), O_RDONLY)) != NULL) compressed = 1; } --- 1211,1216 ---- strcat(infile, ".gz"); if (stat(infile, &statbuf) == 0) { ! if ((f = popen(tprintf(" %s < %s", mudconf.uncompress, ! infile), "r")) != NULL) compressed = 1; } *************** *** 1222,1226 **** if (compressed == 0) { StringCopy(infile, mudconf.indb); ! if ((f = tf_fopen(mudconf.indb, O_RDONLY)) == NULL) return -1; } --- 1221,1225 ---- if (compressed == 0) { StringCopy(infile, mudconf.indb); ! if ((f = fopen(mudconf.indb, "r")) == NULL) return -1; } *************** *** 1233,1243 **** log_text(infile); ENDLOG; ! } if (db_read(f, &db_format, &db_version, &db_flags) < 0) { STARTLOG(LOG_ALWAYS, "INI", "FATAL") { log_text((char *) "Error loading "); log_text(infile); ENDLOG; ! } return -1; } if (mudconf.have_comsys || mudconf.have_macros) load_comsys_and_macros(mudconf.commac_db); --- 1232,1253 ---- log_text(infile); ENDLOG; ! }; ! if (db_read(f, &db_format, &db_version, &db_flags) < 0) { STARTLOG(LOG_ALWAYS, "INI", "FATAL") { log_text((char *) "Error loading "); log_text(infile); ENDLOG; ! } ! if (compressed) ! pclose(f); ! else ! fclose(f); ! return -1; } + if (compressed) + pclose(f); + else + fclose(f); + if (mudconf.have_comsys || mudconf.have_macros) load_comsys_and_macros(mudconf.commac_db); *************** *** 1259,1273 **** * everything ok */ - #ifndef VMS - if (compressed) - tf_pclose(f); - else - tf_fclose(f); - #else - tf_fclose(f); - #endif /* - * VMS - */ - return (0); } --- 1269,1272 ---- *************** *** 1442,1448 **** exit(1); } fclose(stdin); fclose(stdout); ! #if defined(HAVE_IEEEFP_H) && defined(HAVE_SYS_UCONTEXT_H) --- 1441,1449 ---- exit(1); } + + #ifdef CLOSE_STDIN fclose(stdin); fclose(stdout); ! #endif #if defined(HAVE_IEEEFP_H) && defined(HAVE_SYS_UCONTEXT_H) *************** *** 1454,1458 **** #endif - tf_init(); #ifdef RADIX_COMPRESSION init_string_compress(); --- 1455,1458 ---- Index: help.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/help.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** help.c 7 Jan 2002 09:58:32 -0000 1.2 --- help.c 8 Aug 2004 23:48:11 -0000 1.2.2.1 *************** *** 59,63 **** hashflush(htab, 0); ! if ((fp = tf_fopen(filename, O_RDONLY)) == NULL) { STARTLOG(LOG_PROBLEMS, "HLP", "RINDX") { p = alloc_lbuf("helpindex_read.LOG"); --- 59,63 ---- hashflush(htab, 0); ! if ((fp = fopen(filename, "r")) == NULL) { STARTLOG(LOG_PROBLEMS, "HLP", "RINDX") { p = alloc_lbuf("helpindex_read.LOG"); *************** *** 114,118 **** free(htab_entry); } ! tf_fclose(fp); hashreset(htab); return count; --- 114,118 ---- free(htab_entry); } ! fclose(fp); hashreset(htab); return count; *************** *** 195,199 **** return; } ! if ((fp = tf_fopen(filename, O_RDONLY)) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); STARTLOG(LOG_PROBLEMS, "HLP", "OPEN") { --- 195,199 ---- return; } ! if ((fp = fopen(filename, "r")) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); STARTLOG(LOG_PROBLEMS, "HLP", "OPEN") { *************** *** 215,219 **** ENDLOG; } ! tf_fclose(fp); return; --- 215,219 ---- ENDLOG; } ! fclose(fp); return; *************** *** 240,244 **** notify(player, line); } ! tf_fclose(fp); free_lbuf(line); free_lbuf(result); --- 240,244 ---- notify(player, line); } ! fclose(fp); free_lbuf(line); free_lbuf(result); Index: macro.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/macro.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** macro.c 3 Jan 2002 00:59:52 -0000 1.1.1.1 --- macro.c 8 Aug 2004 23:48:11 -0000 1.1.1.1.2.1 *************** *** 531,541 **** cmd = alias; for (; *cmd && *cmd != ' ' && *cmd != '='; cmd++); ! if (!*cmd) { notify(player, "MACRO: You must specify an = in your macro definition"); return; } - while (*cmd && *cmd != '=') - *cmd++ = 0; *cmd++ = 0; while (*cmd && *cmd == ' ') --- 531,541 ---- cmd = alias; for (; *cmd && *cmd != ' ' && *cmd != '='; cmd++); ! while (*cmd && *cmd == ' ') ! *cmd++ = '\0'; ! if (*cmd != '=') { notify(player, "MACRO: You must specify an = in your macro definition"); return; } *cmd++ = 0; while (*cmd && *cmd == ' ') Index: mail.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/mail.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** mail.c 3 Jan 2002 01:00:12 -0000 1.1.1.1 --- mail.c 8 Aug 2004 23:48:11 -0000 1.1.1.1.2.1 *************** *** 2489,2493 **** { struct mail *mp, *nextp; ! struct tm then_tm; time_t then, now = time(0); time_t expire_secs = mudconf.mail_expiration * 86400; --- 2489,2493 ---- { struct mail *mp, *nextp; ! struct tm then_tm = { 0 }; time_t then, now = time(0); time_t expire_secs = mudconf.mail_expiration * 86400; Index: p.db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/p.db.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** p.db.h 3 Jan 2002 01:00:08 -0000 1.1.1.1 --- p.db.h 8 Aug 2004 23:48:11 -0000 1.1.1.1.2.1 *************** *** 14,24 **** /* db.c */ - void tf_init(void); - int tf_open(char *fname, int mode); - int tf_socket(int fam, int typ); - void tf_close(int fdes); - FILE *tf_fopen(char *fname, int mode); - void tf_fclose(FILE * fd); - FILE *tf_popen(char *fname, int mode); void fwdlist_set(dbref thing, FWDLIST * ifp); void fwdlist_clr(dbref thing); --- 14,17 ---- Index: p.sa-db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/p.sa-db.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** p.sa-db.h 3 Jan 2002 00:59:30 -0000 1.1.1.1 --- p.sa-db.h 8 Aug 2004 23:48:11 -0000 1.1.1.1.2.1 *************** *** 14,23 **** /* sa-db.c */ - void tf_init(void); - int tf_open(char *fname, int mode); - void tf_close(int fdes); - FILE *tf_fopen(char *fname, int mode); - void tf_fclose(FILE * fd); - FILE *tf_popen(char *fname, int mode); int fwdlist_load(FWDLIST * fp, dbref player, char *atext); int fwdlist_rewrite(FWDLIST * fp, char *atext); --- 14,17 ---- Index: predicates.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/predicates.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** predicates.c 3 Jan 2002 00:59:30 -0000 1.1.1.1 --- predicates.c 8 Aug 2004 23:48:11 -0000 1.1.1.1.2.1 *************** *** 41,45 **** #endif { ! static char buff[20000]; va_list ap; --- 41,45 ---- #endif { ! static char buff[LBUF_SIZE]; va_list ap; *************** *** 53,57 **** #endif ! vsprintf(buff, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; --- 53,57 ---- #endif ! vsnprintf(buff, LBUF_SIZE, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; *************** *** 66,70 **** #endif { ! static char buff[20000]; va_list ap; --- 66,70 ---- #endif { ! static char buff[LBUF_SIZE]; va_list ap; *************** *** 86,90 **** */ ! vsprintf(buff, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; --- 86,90 ---- */ ! vsnprintf(buff, LBUF_SIZE, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; Index: wiz.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/wiz.c,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** wiz.c 30 Sep 2003 01:38:35 -0000 1.1.1.1.2.1 --- wiz.c 8 Aug 2004 23:48:11 -0000 1.1.1.1.2.2 *************** *** 44,48 **** char *arg1, *arg2; { ! dbref victim, destination, loc; char *to; int hush = 0; --- 44,48 ---- char *arg1, *arg2; { ! dbref victim, destination, loc, exitloc; char *to; int hush = 0; *************** *** 74,78 **** */ ! if (!Has_location(victim)) { notify_quiet(player, "You can't teleport that."); return; --- 74,78 ---- */ ! if (!Has_location(victim) && Typeof(victim) != TYPE_EXIT) { notify_quiet(player, "You can't teleport that."); return; *************** *** 88,95 **** } /* ! * Check for teleporting home */ ! if (!string_compare(to, "home")) { (void) move_via_teleport(victim, HOME, cause, 0); return; --- 88,96 ---- } /* ! * Check for teleporting home ! * Also, can't teleport exits 'home' */ ! if (!string_compare(to, "home") && Typeof(victim) != TYPE_EXIT) { (void) move_via_teleport(victim, HOME, cause, 0); return; *************** *** 126,131 **** /* * If fascist teleport is on, you must control the victim's ultimate ! * * * * * location (after LEAVEing any objects) or it must be ! * JUMP_OK. */ --- 127,131 ---- /* * If fascist teleport is on, you must control the victim's ultimate ! * location (after LEAVEing any objects) or it must be JUMP_OK. */ *************** *** 167,175 **** hush = HUSH_ENTER | HUSH_LEAVE; ! if (move_via_teleport(victim, destination, cause, hush)) { ! if (player != victim) { ! if (!Quiet(player)) notify_quiet(player, "Teleported."); - } } } else if (isExit(destination)) { --- 167,181 ---- hush = HUSH_ENTER | HUSH_LEAVE; ! if (Typeof(victim) == TYPE_EXIT) { ! exitloc = Exits(victim); ! s_Exits(exitloc, remove_first(Exits(exitloc), victim)); ! s_Exits(destination, insert_first(Exits(destination), victim)); ! s_Exits(victim, destination); ! ! if (!Quiet(player)) ! notify_quiet(player, "Exit teleported."); ! } else if (move_via_teleport(victim, destination, cause, hush)) { ! if (player != victim && !Quiet(player)) notify_quiet(player, "Teleported."); } } else if (isExit(destination)) { |
From: Thomas W. <two...@us...> - 2004-08-08 23:48:38
|
Update of /cvsroot/btech/btechmux/tree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12777/tree Modified Files: Tag: btmux_1_4-branch mux_tree.c Log Message: Annual (ahem) sync with the BitKeeper btechmux-stable tree (at btechmux.bkbits.net/btechmux-stable). 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: # -------------------------------------------- # 03/09/30 th...@st... 1.26 # 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/10/01 th...@st... 1.27 # 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.28.1.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.30 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/10/01 th...@ce... 1.31 # Ice glitchfixes: break through it while standing, and don't survive as tank breaking ice. # -------------------------------------------- # 03/10/01 th...@ce... 1.32 # More ice glitch fixes: properly break ice when picking a unit (but not a MechWarrior) up through it. # -------------------------------------------- # 03/10/01 th...@ce... 1.33 # Wups... don't sink hovertows. # -------------------------------------------- # 03/10/05 th...@st... 1.34 # Make MUX function 'btgetdbrefbyid' accept a map as well as a 'mech as its first argument. # -------------------------------------------- # 03/10/12 th...@st... 1.35 # - 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.36 # - Consider OOD-ing 'mechs as Jumping 'mechs where appropriate. # -------------------------------------------- # 03/10/14 th...@st... 1.37 # Add new 'c' option to LRS, for colorized terrain. # -------------------------------------------- # 03/10/14 th...@st... 1.38 # Don't cliff hovers that go from l0 bridge to l1 bridge. # -------------------------------------------- # 03/10/14 th...@st... 1.39 # Don't drown vehicles that manage to break l0 ice. # -------------------------------------------- # 03/10/15 th...@st... 1.40 # 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.41 # - Add 'tactical b', for displaying valid DropShip landing zones # - Add the ability to run 'checklz x y' for hexes in TacRange. # -------------------------------------------- # 03/10/19 th...@st... 1.42 # - 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.43 # 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.44 # Patch from Tony to make tel() and @tel 'teleport' exits the same way the 'drop' command does. # -------------------------------------------- # 03/10/21 th...@st... 1.45 # Fix eternal loop when calling btdamagemech() with a 'clustersize' of 0. # -------------------------------------------- # 03/10/31 th...@st... 1.46 # Glitchfix. # -------------------------------------------- # 03/10/31 th...@st... 1.47 # Possibly fix memory corruption problems 3030 has been having, by fixing around tprintf (as suggested by Null @ 3029.) # -------------------------------------------- # 03/11/14 th...@ce... 1.44.1.1 # Fix buglet in btlostohex(): use proper range. # -------------------------------------------- # 03/11/15 th...@st... 1.48 # Fix possibly malicious crashing bug in macros. # -------------------------------------------- # 03/11/15 th...@ce... 1.49 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/11/20 th...@st... 1.50 # Misc cleanup fixes. Stuff that probably didn't cause any real-world bugs, but should be fixed anyway. # -------------------------------------------- # 03/11/23 th...@st... 1.51 # - 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/09 th...@st... 1.52 # Fix off-by-one error in reading maps with an X size of MAPX (1000 by default.) # -------------------------------------------- # 04/02/10 th...@st... 1.53 # Open help/news files for reading, not writing. Oopsie from last changeset. # -------------------------------------------- # 04/02/12 th...@st... 1.54 # remove unused file. # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.1 # foobar changeset # -------------------------------------------- # 04/03/05 th...@ce... 1.49.1.2 # foobar2 # -------------------------------------------- # 04/05/08 th...@st... 1.55 # 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.56 # Protect some xcodevalues from being changed, to avoid memory corruption and the like. # -------------------------------------------- # 04/05/09 th...@st... 1.57 # 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.58 # Fix typo in previous checkin, and compile before checking in. # -------------------------------------------- # 04/05/11 th...@ce... 1.59 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 04/05/11 th...@ce... 1.60 # Fix compiler warnings: # - Add a few missing include files # - Remove unused variables # -------------------------------------------- # 04/05/11 th...@ce... 1.61 # 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.62 # Fix off-by-one error in the kick-decision range check in autopilots. # -------------------------------------------- # 04/07/29 th...@st... 1.63 # Attempt to improve the dieroll's randomness somewhat. # -------------------------------------------- Index: mux_tree.c =================================================================== RCS file: /cvsroot/btech/btechmux/tree/mux_tree.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** mux_tree.c 2 Feb 2002 11:53:32 -0000 1.2 --- mux_tree.c 8 Aug 2004 23:48:21 -0000 1.2.2.1 *************** *** 30,33 **** --- 30,35 ---- #include <malloc.h> #include <stdio.h> + #include <stdlib.h> + #include <string.h> #include "tree.h" |
From: SourceForge.net <no...@so...> - 2004-05-09 10:07:33
|
Patches item #920275, was opened at 2004-03-21 00:35 Message generated for change (Comment added) made by twouters You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=435200&aid=920275&group_id=43080 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Martin Murray (murrayma) >Assigned to: Thomas Wouters (twouters) Summary: Fixes a bug in mech.combat.c:FireWeapon() Initial Comment: Its missing a check, the patch is obvious. -Malaclypse@3021 ---------------------------------------------------------------------- >Comment By: Thomas Wouters (twouters) Date: 2004-05-09 12:07 Message: Logged In: YES user_id=34209 Thanks, patched in the bitkeeper tree. I'll sync with CVS soon. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=435200&aid=920275&group_id=43080 |
From: SourceForge.net <no...@so...> - 2004-03-20 23:35:53
|
Patches item #920275, was opened at 2004-03-20 18:35 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=435200&aid=920275&group_id=43080 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martin Murray (murrayma) Assigned to: Nobody/Anonymous (nobody) Summary: Fixes a bug in mech.combat.c:FireWeapon() Initial Comment: Its missing a check, the patch is obvious. -Malaclypse@3021 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=435200&aid=920275&group_id=43080 |
Update of /cvsroot/btech/btechmux/src/hcode/btech In directory sc8-pr-cvs1:/tmp/cvs-serv2119/src/hcode/btech Modified Files: Tag: btmux_1_4-branch autogun.c btmacros.h map.c map.los.c mech.advanced.c mech.combat.c mech.combat.misc.c mech.consistency.c mech.contacts.c mech.damage.c mech.fire.c mech.h mech.lite.c mech.los.c mech.move.c mech.notify.c mech.physical.c mech.sensor.c mech.sensor.functions.c mech.update.c mech.utils.c p.map.h p.mech.advanced.h p.mech.fire.h p.mech.utils.h weapons.fasa.h weapons.h weapons.vrt.h Removed Files: Tag: btmux_1_4-branch .depend Makefile Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. Index: autogun.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/autogun.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** autogun.c 3 Jan 2002 01:01:14 -0000 1.1.1.1 --- autogun.c 30 Sep 2003 01:38:35 -0000 1.1.1.1.2.1 *************** *** 166,171 **** if (MechTeam(t) == MechTeam(mech)) continue; ! if (!(map->LOSinfo[mech->mapnumber][t-> ! mapnumber] & MECHLOSFLAG_SEEN)) continue; if ((targetrange[target_count] = --- 166,170 ---- if (MechTeam(t) == MechTeam(mech)) continue; ! if (!(MechToMech_LOSFlag(map, mech, t) & MECHLOSFLAG_SEEN)) continue; if ((targetrange[target_count] = Index: btmacros.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/btmacros.h,v retrieving revision 1.12.2.18 retrieving revision 1.12.2.19 diff -C2 -d -r1.12.2.18 -r1.12.2.19 *** btmacros.h 14 Sep 2003 10:37:29 -0000 1.12.2.18 --- btmacros.h 30 Sep 2003 01:38:35 -0000 1.12.2.19 *************** *** 163,166 **** --- 163,173 ---- #define SetMechPKiller(a) (MechPrefs(a) |= MECHPREF_PKILL) #define UnSetMechPKiller(a) (MechPrefs(a) &= ~MECHPREF_PKILL) + #define MechSLWarn(a) (MechPrefs(a) & MECHPREF_SLWARN) + #define MechAutoFall(a) (MechPrefs(a) & MECHPREF_AUTOFALL) + #define MechArmorWarn(a) (!(MechPrefs(a) & MECHPREF_NOARMORWARN)) + #define MechAmmoWarn(a) (!(MechPrefs(a) & MECHPREF_NOAMMOWARN)) + #define MechFailStand(a) (!(MechPrefs(a) & MECHPREF_NOFAILSTAND)) + #define MechAutoconSD(a) (MechPrefs(a) & MECHPREF_AUTOCON_SD) + #define MechNoFriendlyFire(a) (MechPrefs(a) & MECHPREF_NOFRIENDLYFIRE) #define MechWalkXPFactor(a) (a)->rd.wxf #define MechPilot(a) (a)->pd.pilot *************** *** 345,356 **** #define StunCrew(a) MECHEVENT(a, EVENT_UNSTUN_CREW, unstun_crew_event, 60, 0) ! #define Burning(a) event_count_type_data(EVENT_VEHICLEBURN, (void *) a) ! #define BurningSide(a,side) event_count_type_data_data(EVENT_VEHICLEBURN, (void *) a, (void *) side) #define StopBurning(a) event_remove_type_data(EVENT_VEHICLEBURN, (void *) a) #define StopBurningSide(a,side) event_remove_type_data_data(EVENT_VEHICLEBURN, (void *) a, (void *) side) ! #define Extinguishing(a) event_count_type_data(EVENT_VEHICLE_EXTINGUISH, (void *) a) ! #define Jellied(a) MechCritStatus(a) & JELLIED #define Exploding(a) event_count_type_data(EVENT_EXPLODE, (void *) a) ! #define Dumping(a) event_count_type_data(EVENT_DUMP, (void *) a) #define Dumping_Type(a,type) (event_count_type_data_data(EVENT_DUMP, (void *) a, (void *) type) || event_count_type_data_data(EVENT_DUMP, (void *) a, (void *) 0)) #define DumpingData(a,data2) event_get_type_data(EVENT_DUMP, (void *) a, (void *) data2) --- 352,363 ---- #define StunCrew(a) MECHEVENT(a, EVENT_UNSTUN_CREW, unstun_crew_event, 60, 0) ! #define Burning(a) event_count_type_data(EVENT_VEHICLEBURN, (void *) a) ! #define BurningSide(a,side) event_count_type_data_data(EVENT_VEHICLEBURN, (void *) a, (void *) side) #define StopBurning(a) event_remove_type_data(EVENT_VEHICLEBURN, (void *) a) #define StopBurningSide(a,side) event_remove_type_data_data(EVENT_VEHICLEBURN, (void *) a, (void *) side) ! #define Extinguishing(a) event_count_type_data(EVENT_VEHICLE_EXTINGUISH, (void *) a) ! #define Jellied(a) (MechCritStatus(a) & JELLIED) #define Exploding(a) event_count_type_data(EVENT_EXPLODE, (void *) a) ! #define Dumping(a) event_count_type_data(EVENT_DUMP, (void *) a) #define Dumping_Type(a,type) (event_count_type_data_data(EVENT_DUMP, (void *) a, (void *) type) || event_count_type_data_data(EVENT_DUMP, (void *) a, (void *) 0)) #define DumpingData(a,data2) event_get_type_data(EVENT_DUMP, (void *) a, (void *) data2) *************** *** 648,654 **** #define StartSpinning(mech) (MechCritStatus(mech) |= SPINNING) ! #define IsLit2(mech) (MechCritStatus(mech) & SLITE_LIT) ! #define IsLit3(mech) (MechSpecialsStatus(mech) & SLITE_ON) ! #define IsLit(mech) (IsLit2(mech) || IsLit3(mech)) #define OkayCritSect(sect,num,ok) OkayCritSect2(mech,sect,num,ok) --- 655,661 ---- #define StartSpinning(mech) (MechCritStatus(mech) |= SPINNING) ! #define MechLit(mech) (MechCritStatus(mech) & SLITE_LIT) ! #define MechLites(mech) (MechSpecialsStatus(mech) & SLITE_ON) ! #define IsLit(mech) (MechLit(mech) || MechLites(mech)) #define OkayCritSect(sect,num,ok) OkayCritSect2(mech,sect,num,ok) *************** *** 794,797 **** --- 801,813 ---- #define MechIsObservator(mech) (MechCritStatus(mech) & OBSERVATORIC) + + /* Macros related to map.h stuff */ + #define MechLOSFlag_WoodCount(flag) \ + (((flag) / MECHLOSFLAG_WOOD) % MECHLOSMAX_WOOD) + #define MechLOSFlag_WaterCount(flag) \ + (((flag) / MECHLOSFLAG_WATER) % MECHLOSMAX_WATER) + + #define MechToMech_LOSFlag(map, from, to) \ + ((map)->LOSinfo[from->mapnumber][to->mapnumber]) #endif /* BTMACROS_H */ Index: map.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/map.c,v retrieving revision 1.1.1.1.2.5 retrieving revision 1.1.1.1.2.6 diff -C2 -d -r1.1.1.1.2.5 -r1.1.1.1.2.6 *** map.c 6 Dec 2002 14:28:42 -0000 1.1.1.1.2.5 --- map.c 30 Sep 2003 01:38:36 -0000 1.1.1.1.2.6 *************** *** 36,39 **** --- 36,40 ---- #include "p.debug.h" + void debug_fixmap(dbref player, void *data, char *buffer) { *************** *** 228,235 **** } ! void map_loadmap(dbref player, void *data, char *buffer) { - MAP *map; - char *args[1]; char openfile[50]; char terr, elev; --- 229,234 ---- } ! int map_load(MAP * map, char * mapname) { char openfile[50]; char terr, elev; *************** *** 239,259 **** int i, j = 0, height, width, filemode; ! map = (MAP *) data; ! ! if (!CheckData(player, map)) ! return; ! ! DOCHECK(mech_parseattributes(buffer, args, 1) != 1, ! "Invalid number of arguments!"); ! if (strlen(args[0]) >= MAP_NAME_SIZE) ! args[MAP_NAME_SIZE] = 0; ! sprintf(openfile, "%s/", MAP_PATH); ! strcat(openfile, args[0]); ! DOCHECK(!(fp = ! my_open_file(openfile, "r", &filemode)), ! tprintf("Unable to read %s!", args[0])); del_mapobjs(map); /* Just in case */ - notify(player, tprintf("Loading %s", args[0])); - /* free the old map if there is one there for some reason */ if (map->map) { for (i = 0; i < map->map_height; i++) --- 238,249 ---- int i, j = 0, height, width, filemode; ! if (strlen(mapname) >= MAP_NAME_SIZE) ! mapname[MAP_NAME_SIZE] = 0; ! sprintf(openfile, "%s/%s", MAP_PATH, mapname); ! fp = my_open_file(openfile, "r", &filemode); ! if (!fp) { ! return -1; ! } del_mapobjs(map); /* Just in case */ if (map->map) { for (i = 0; i < map->map_height; i++) *************** *** 264,268 **** height > MAPY || width < 1 || width > MAPX) { SendError(tprintf("Map #%d: Invalid height and/or width", ! map->mynum)); width = DEFAULT_MAP_WIDTH; height = DEFAULT_MAP_HEIGHT; --- 254,258 ---- height > MAPY || width < 1 || width > MAPX) { SendError(tprintf("Map #%d: Invalid height and/or width", ! map->mynum)); width = DEFAULT_MAP_WIDTH; height = DEFAULT_MAP_HEIGHT; *************** *** 296,302 **** } if (!strcmp(GetTerrainName_base(terr), "Unknown")) { ! SendError(tprintf ! ("Map #%d: Invalid terrain at %d,%d: '%c'", map->mynum, ! j, i, terr)); terr = GRASSLAND; } --- 286,291 ---- } if (!strcmp(GetTerrainName_base(terr), "Unknown")) { ! SendError(tprintf("Map #%d: Invalid terrain at %d,%d: '%c'", ! map->mynum, j, i, terr)); terr = GRASSLAND; } *************** *** 305,313 **** } if (i != height) { ! SendError(tprintf ! ("Error: EOF reached prematurely. (x%d != %d || y%d != %d)", j, ! width, i, height)); my_close_file(fp, &filemode); ! return; } map->grav = 100; --- 294,301 ---- } if (i != height) { ! SendError(tprintf("Error: EOF reached prematurely. " ! "(x%d != %d || y%d != %d)", j, width, i, height)); my_close_file(fp, &filemode); ! return -2; } map->grav = 100; *************** *** 324,334 **** if (!MapNoBridgify(map)) make_bridges(map); ! sprintf(map->mapname, args[0]); ! notify(player, "Loading complete!"); my_close_file(fp, &filemode); ! notify(player, "Clearing Mechs off Newly Loaded Map"); ! if (player != 1) map_clearmechs(player, data, ""); } --- 312,352 ---- if (!MapNoBridgify(map)) make_bridges(map); ! sprintf(map->mapname, mapname); my_close_file(fp, &filemode); + return 0; + } ! void map_loadmap(dbref player, void *data, char *buffer) ! { ! MAP *map; ! char *args[1]; ! ! map = (MAP *) data; ! ! if (!CheckData(player, map)) ! return; ! ! DOCHECK(mech_parseattributes(buffer, args, 1) != 1, ! "Invalid number of arguments!"); ! notify(player, tprintf("Loading %s", args[0])); ! switch (map_load(map, args[0])) { ! case -1: ! notify(player, "Map not found."); ! return; ! case -2: ! notify(player, "Map invalid."); ! return; ! case 0: ! notify(player, "Map loaded."); ! break; ! default: ! notify(player, "Unknown error while loading map!"); ! return; ! } ! ! if (player != 1) { ! notify(player, "Clearing Mechs off Newly Loaded Map"); map_clearmechs(player, data, ""); + } } Index: map.los.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/map.los.c,v retrieving revision 1.3.2.9 retrieving revision 1.3.2.10 diff -C2 -d -r1.3.2.9 -r1.3.2.10 *** map.los.c 10 Dec 2002 13:04:17 -0000 1.3.2.9 --- map.los.c 30 Sep 2003 01:38:36 -0000 1.3.2.10 *************** *** 291,295 **** } ! if (!IsLit3(mech)) continue; --- 291,295 ---- } ! if (!MechLites(mech)) continue; Index: mech.advanced.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.advanced.c,v retrieving revision 1.3.2.5 retrieving revision 1.3.2.6 diff -C2 -d -r1.3.2.5 -r1.3.2.6 *** mech.advanced.c 8 Aug 2002 11:46:29 -0000 1.3.2.5 --- mech.advanced.c 30 Sep 2003 01:38:36 -0000 1.3.2.6 *************** *** 23,26 **** --- 23,27 ---- #include "mech.h" #include "mech.events.h" + #include "coolmenu.h" #include "p.mech.ecm.h" #include "mech.ecm.h" *************** *** 1726,1727 **** --- 1727,1834 ---- return; } + + #define MECHPREF_FLAG_INVERTED 0x01 + #define MECHPREF_FLAG_NEGATIVE 0x02 + + static struct mechpref_info { + unsigned char bit; + unsigned char flags; + char * name; + char * msg; + } mech_preferences[] = { + { MECHPREF_PKILL, MECHPREF_FLAG_INVERTED, "MWSafety", + "MechWarrior Safeties flipped" }, + { MECHPREF_SLWARN, 0, "SLWarn", + "The warning when lit by searchlight is now" }, + { MECHPREF_AUTOFALL, MECHPREF_FLAG_NEGATIVE, "AutoFall", + "Suicidal jumps off cliffs toggled" }, + { MECHPREF_NOARMORWARN, MECHPREF_FLAG_INVERTED, "ArmorWarn", + "Low-armor warnings turned" }, + { MECHPREF_NOAMMOWARN, MECHPREF_FLAG_INVERTED, "AmmoWarn", + "Warning when running out of Ammunition switched" }, + { MECHPREF_AUTOCON_SD, MECHPREF_FLAG_NEGATIVE, "AutoconShutdown", + "Autocon on shutdown units turned" }, + { MECHPREF_NOFRIENDLYFIRE, 0, "FFSafety", + "Friendly Fire Safeties flipped" }, + }; + #define NUM_MECHPREFERENCES (sizeof(mech_preferences) / sizeof(struct mechpref_info)) + + static MECH *target_mech; + + static char *display_mechpref(int i) + { + static char buf[256]; + struct mechpref_info info = mech_preferences[i]; + char * state; + + 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) + state = "%ch%cgOFF%cn"; + else + state = "%ch%crOFF%cn"; + } else { + if (info.flags & MECHPREF_FLAG_NEGATIVE) + state = "%ch%crON%cn"; + else + state = "%ch%cgON%cn"; + } + + sprintf(buf, " %-40s%s", info.name, state); + return buf; + } + + void mech_mechprefs(dbref player, void * data, char * buffer) + { + MECH * mech = (MECH *) data; + int nargs; + char *args[2]; + coolmenu *c; + + cch(MECH_USUALSMO); + nargs = mech_parseattributes(buffer, args, 1); + if (!nargs) { + /* Show mechprefs */ + target_mech = mech; + c = SelCol_FunStringMenuK(1, "Mech Preferences", display_mechpref, + NUM_MECHPREFERENCES); + ShowCoolMenu(player, c); + KillCoolMenu(c); + } else { + int i; + struct mechpref_info info; + char *newstate; + + for (i = 0; i < NUM_MECHPREFERENCES; i++) { + if (strcasecmp(args[0], mech_preferences[i].name) == 0) + break; + } + if (i == NUM_MECHPREFERENCES) { + notify(player, tprintf("Unknown MechPreference: %s", args[0])); + return; + } + info = mech_preferences[i]; + if (MechPrefs(mech) & info.bit) + MechPrefs(mech) &= ~(info.bit); + else + 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) + newstate = "%ch%cgOFF%cn"; + else + newstate = "%ch%crOFF%cn"; + } else { + if (info.flags & MECHPREF_FLAG_NEGATIVE) + newstate = "%ch%crON%cn"; + else + newstate = "%ch%cgON%cn"; + } + notify(player, tprintf("%s %s", info.msg, newstate)); + } + } Index: mech.combat.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.combat.c,v retrieving revision 1.7.2.11 retrieving revision 1.7.2.12 diff -C2 -d -r1.7.2.11 -r1.7.2.12 *** mech.combat.c 3 Jun 2003 18:26:42 -0000 1.7.2.11 --- mech.combat.c 30 Sep 2003 01:38:36 -0000 1.7.2.12 *************** *** 504,508 **** { ishex = 1; ! if (!IsArtillery(weaptype) && MechLockFire(mech)) /* look for enemies in the default hex cause they may have moved */ if ((tempMech = --- 504,508 ---- { ishex = 1; ! if (!sight && !IsArtillery(weaptype) && MechLockFire(mech)) /* look for enemies in the default hex cause they may have moved */ if ((tempMech = *************** *** 572,576 **** DOCHECK0(mapx < 0 || mapx >= mech_map->map_width || mapy < 0 || mapy >= mech_map->map_height, "Map coordinates out of range!"); ! if (!IsArtillery(weaptype)) /* look for enemies in that hex... */ if ((tempMech = --- 572,576 ---- DOCHECK0(mapx < 0 || mapx >= mech_map->map_width || mapy < 0 || mapy >= mech_map->map_height, "Map coordinates out of range!"); ! if (!sight && !IsArtillery(weaptype)) /* look for enemies in that hex... */ if ((tempMech = *************** *** 609,612 **** --- 609,615 ---- ((MechTarget(mech) != tempMech->mynum) || Locking(mech)), "You need a stable lock to fire on that target!"); + DOCHECK0(MechTeam(tempMech) == MechTeam(mech) && + MechNoFriendlyFire(mech), + "You can't fire on a teammate with FFSafeties on!"); DOCHECK0(MechType(tempMech) == CLASS_MW && MechType(mech) != CLASS_MW && Index: mech.combat.misc.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.combat.misc.c,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** mech.combat.misc.c 21 Jul 2002 23:20:48 -0000 1.5.2.2 --- mech.combat.misc.c 30 Sep 2003 01:38:36 -0000 1.5.2.3 *************** *** 144,147 **** --- 144,151 ---- SetWCheck(mech); + + if (!MechAmmoWarn(mech)) + return; + for (i = 0; i < NUM_CRITICALS; i++) { cl = CritsInLoc(mech, i); Index: mech.consistency.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.consistency.c,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -C2 -d -r1.6.2.2 -r1.6.2.3 *** mech.consistency.c 6 Dec 2002 14:20:39 -0000 1.6.2.2 --- mech.consistency.c 30 Sep 2003 01:38:36 -0000 1.6.2.3 *************** *** 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.contacts.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.contacts.c,v retrieving revision 1.6.2.4 retrieving revision 1.6.2.5 diff -C2 -d -r1.6.2.4 -r1.6.2.5 *** mech.contacts.c 13 Jul 2002 14:18:22 -0000 1.6.2.4 --- mech.contacts.c 30 Sep 2003 01:38:36 -0000 1.6.2.5 *************** *** 164,171 **** statusstr[sptr++] = 'B'; ! if (IsLit3(target)) statusstr[sptr++] = 'L'; ! if (IsLit2(target)) statusstr[sptr++] = 'l'; --- 164,171 ---- statusstr[sptr++] = 'B'; ! if (MechLites(target)) statusstr[sptr++] = 'L'; ! if (MechLit(target)) statusstr[sptr++] = 'l'; *************** *** 221,225 **** case 2: cRet = Destroyed(mechTarget) ? 'D' : ! IsLit2(mechTarget) ? 'l' : IsLit3(mechTarget) ? 'L' : ' '; break; case 3: --- 221,225 ---- case 2: cRet = Destroyed(mechTarget) ? 'D' : ! MechLites(mechTarget) ? 'L' : MechLit(mechTarget) ? 'l' : ' '; break; case 3: Index: mech.damage.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.damage.c,v retrieving revision 1.5.2.9 retrieving revision 1.5.2.10 diff -C2 -d -r1.5.2.9 -r1.5.2.10 *** mech.damage.c 7 Dec 2002 18:28:20 -0000 1.5.2.9 --- mech.damage.c 30 Sep 2003 01:38:36 -0000 1.5.2.10 *************** *** 224,236 **** } } ! if (seriousness > 0) mech_notify(wounded, MECHALL, tprintf("%sWARNING: %s%s Armor %s", ! MySeriousColorStr(wounded, ! seriousness), ! ShortArmorSectionString ! (MechType(wounded), ! MechMove(wounded), hitloc), ! isrear ? " (Rear)" : "", MySeriousStr(wounded, ! seriousness))); return intDamage > 0 ? intDamage : 0; } --- 224,233 ---- } } ! if (seriousness > 0 && MechArmorWarn(wounded)) mech_notify(wounded, MECHALL, tprintf("%sWARNING: %s%s Armor %s", ! MySeriousColorStr(wounded, seriousness), ! ShortArmorSectionString(MechType(wounded), ! MechMove(wounded), hitloc), ! isrear ? " (Rear)" : "", MySeriousStr(wounded, seriousness))); return intDamage > 0 ? intDamage : 0; } Index: mech.fire.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.fire.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** mech.fire.c 18 Jan 2002 14:21:53 -0000 1.2 --- mech.fire.c 30 Sep 2003 01:38:36 -0000 1.2.2.1 *************** *** 136,139 **** --- 136,140 ---- "Your tank is started! You can not extinguish the flames while your tank is started!"); DOCHECK(!Burning(mech), "This unit is not on fire!"); + DOCHECK(Extinguishing(mech), "You're already trying to put out the fire!"); mech_notify(mech, MECHALL, "You begin to exitinguish the fires!"); *************** *** 141,144 **** --- 142,169 ---- MECHEVENT(mech, EVENT_VEHICLE_EXTINGUISH, vehicle_extinquish_fire_event, VEHICLE_EXTINGUISH_TICK, 0); + } + + /* + * Mechs entering level 2 water, or proning in level 1 water should + * extinguish any inferno currently burning. + */ + void water_extinguish_inferno(MECH * mech) + { + int elev = MechElevation(mech); + MAP * map = getMap(mech->mapindex); + + if (!InWater(mech) || MechType(mech) != CLASS_MECH || + !Jellied(mech) || (elev == -1 && !Fallen(mech))) + return; + + event_remove_type_data(EVENT_BURN, (void *) mech); + MechCritStatus(mech) &= ~JELLIED; + + mech_notify(mech, MECHALL, "The flames extinguish in a roar of steam!"); + MechLOSBroadcast(mech, "is surrounded by a plume of steam as the flames extinguish."); + + /* According to FASA, the inferno jelly should keep on burning on the + * water hex. We'll just add some steam (smoke) instead. */ + add_decoration(map, MechX(mech), MechY(mech), TYPE_SMOKE, SMOKE, 120); } Index: mech.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.h,v retrieving revision 1.9.2.8 retrieving revision 1.9.2.9 diff -C2 -d -r1.9.2.8 -r1.9.2.9 *** mech.h 10 Dec 2002 13:50:53 -0000 1.9.2.8 --- mech.h 30 Sep 2003 01:38:36 -0000 1.9.2.9 *************** *** 569,573 **** /* Mech Preferences list */ ! #define MECHPREF_PKILL 0x01 /* Are you sure you want to kill MWs? */ typedef struct { --- 569,580 ---- /* Mech Preferences list */ ! #define MECHPREF_PKILL 0x01 /* Kill MWs anyway */ ! #define MECHPREF_SLWARN 0x02 /* Warn when lit by slite */ ! #define MECHPREF_AUTOFALL 0x04 /* Jump off cliffs (don't try to avoid) */ ! #define MECHPREF_NOARMORWARN 0x08 /* Don't warn when armor is getting low */ ! #define MECHPREF_NOAMMOWARN 0x10 /* Don't warn when ammo is getting low */ ! #define MECHPREF_STANDANYWAY 0x20 /* Try to stand even when BTH too high */ ! #define MECHPREF_AUTOCON_SD 0x40 /* Autocon on non-started units */ ! #define MECHPREF_NOFRIENDLYFIRE 0x80 /* Disallow firing on teammates */ typedef struct { Index: mech.lite.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.lite.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** mech.lite.c 3 Jan 2002 01:01:28 -0000 1.1.1.1 --- mech.lite.c 30 Sep 2003 01:38:36 -0000 1.1.1.1.2.1 *************** *** 18,55 **** #include "p.mech.utils.h" ! void cause_lite(MECH * mech, MECH * tempMech) { ! /* Selectively and _creatively_ cause light */ ! /* uh. huh. right. */ ! /* See where from mech is facing, compare it to bearing to to mech */ ! /* if within front arc, target's lit */ ! if (IsLit2(tempMech)) ! return; /* No senseless waste of effort */ ! if (!(InWeaponArc(mech, MechFX(tempMech), ! MechFY(tempMech)) & FORWARDARC)) return; ! /* Time for _light_ */ ! MechCritStatus(tempMech) |= SLITE_LIT; } void end_lite_check(MECH * mech) { ! MAP *map; ! MECH *t; int i; ! if (!IsLit2(mech)) return; ! if (!(map = FindObjectsData(mech->mapindex))) return; for (i = 0; i < map->first_free; i++) { if (!(t = FindObjectsData(map->mechsOnMap[i]))) continue; ! if ((MechSpecialsStatus(t) & SLITE_ON) && ! FaMechRange(t, mech) < LITE_RANGE) ! if (InWeaponArc(t, MechFX(mech), MechFY(mech)) & FORWARDARC) ! return; } MechCritStatus(mech) &= ~SLITE_LIT; } --- 18,75 ---- #include "p.mech.utils.h" ! /* If the target is in the front arc, and Line of Sight is not blocked ! * (by terrain, water hexes or more than 2 'points' of wood) and in ! * range, the target is lit. ! */ ! static int mech_lites_target(MECH * mech, MECH * target) { ! MAP * map = getMap(mech->mapindex); ! int losflag = MechToMech_LOSFlag(map, mech, target); ! if (!MechLites(mech)) ! return 0; ! if (FaMechRange(mech, target) > LITE_RANGE) ! return 0; ! if (!(InWeaponArc(mech, MechFX(target), ! MechFY(target)) & FORWARDARC)) ! return 0; ! if ((losflag & MECHLOSFLAG_BLOCK) || ! MechLOSFlag_WoodCount(losflag) > 2 || ! MechLOSFlag_WaterCount(losflag) != 0) ! return 0; ! return 1; ! } ! ! void cause_lite(MECH * mech, MECH * tempMech) ! { ! if (MechLit(tempMech)) return; ! if (mech_lites_target(mech, tempMech)) { ! MechCritStatus(tempMech) |= SLITE_LIT; ! if (MechSLWarn(tempMech)) ! mech_notify(tempMech, MECHALL, "You are being illuminated!"); ! } } void end_lite_check(MECH * mech) { ! MAP * map = getMap(mech->mapindex); ! MECH * t; int i; ! if (!MechLit(mech)) return; ! if (!map) return; for (i = 0; i < map->first_free; i++) { + if (i == mech->mapnumber) + continue; if (!(t = FindObjectsData(map->mechsOnMap[i]))) continue; ! if (mech_lites_target(t, mech)) ! return; } MechCritStatus(mech) &= ~SLITE_LIT; + if (MechSLWarn(mech)) + mech_notify(mech, MECHALL, "You are no longer being illuminated."); } Index: mech.los.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.los.c,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** mech.los.c 24 Jun 2002 14:11:42 -0000 1.2.2.4 --- mech.los.c 30 Sep 2003 01:38:36 -0000 1.2.2.5 *************** *** 286,291 **** /* Possibly do a quickie check only */ if (mech && target) { ! if (map->LOSinfo[mech-> ! mapnumber][target->mapnumber] & MECHLOSFLAG_PARTIAL) MechStatus(target) |= PARTIAL_COVER; else --- 286,290 ---- /* Possibly do a quickie check only */ if (mech && target) { ! if (MechToMech_LOSFlag(map, mech, target) & MECHLOSFLAG_PARTIAL) MechStatus(target) |= PARTIAL_COVER; else *************** *** 293,298 **** return Sensor_ToHitBonus(mech, target, ! map->LOSinfo[mech->mapnumber][target->mapnumber], ! map->maplight, hexRange, wAmmoMode); } return 0; --- 292,297 ---- return Sensor_ToHitBonus(mech, target, ! MechToMech_LOSFlag(map, mech, target), ! map->maplight, hexRange, wAmmoMode); } return 0; *************** *** 310,316 **** } - #define from mech->mapnumber - #define to target->mapnumber - int InLineOfSight(MECH * mech, MECH * target, int x, int y, float hexRange) { --- 309,312 ---- *************** *** 318,322 **** float x1, y1; int arc; ! int i; map = getMap(mech->mapindex); --- 314,318 ---- float x1, y1; int arc; ! int losflag; map = getMap(mech->mapindex); *************** *** 347,374 **** if (mech && target) { #ifndef ADVANCED_LOS ! i = map->LOSinfo[from][to]; ! if (Sensor_CanSee(mech, target, &i, arc, hexRange, map->mapvis, map->maplight, map->cloudbase)) { ! map->LOSinfo[from][to] |= (MECHLOSFLAG_SEEN | MECHLOSFLAG_SEESP | MECHLOSFLAG_SEESS); return 1; } else { ! map->LOSinfo[from][to] &= ~(MECHLOSFLAG_SEEN | MECHLOSFLAG_SEESP | ! MECHLOSFLAG_SEESS); return 0; } #else ! if (map->LOSinfo[from][to] & (MECHLOSFLAG_SEESP | ! MECHLOSFLAG_SEESS)) ! return (map->LOSinfo[from][to] & (MECHLOSFLAG_SEESP | MECHLOSFLAG_SEESS | ! MECHLOSFLAG_BLOCK)); #endif return 0; } ! i = CalculateLOSFlag(mech, NULL, map, x, y, 0, hexRange); ! return Sensor_CanSee(mech, NULL, &i, arc, hexRange, map->mapvis, ! map->maplight, map->cloudbase); } --- 343,370 ---- if (mech && target) { #ifndef ADVANCED_LOS ! losflag = MechToMech_LOSFlag(map, mech, target); ! if (Sensor_CanSee(mech, target, &losflag, arc, hexRange, map->mapvis, map->maplight, map->cloudbase)) { ! map->LOSinfo[mech->mapnumber][target->mapnumber] |= (MECHLOSFLAG_SEEN | MECHLOSFLAG_SEESP | MECHLOSFLAG_SEESS); return 1; } else { ! map->LOSinfo[mech->mapnumber][target->mapnumber] &= ~(MECHLOSFLAG_SEEN | MECHLOSFLAG_SEESP | ! MECHLOSFLAG_SEESS); return 0; } #else ! if (MechToMech_LOSFlag(map, mech, target) & (MECHLOSFLAG_SEESP | ! MECHLOSFLAG_SEESS)) ! return MechToMech_LOSFlag(map, mech, target) & (MECHLOSFLAG_SEESP | MECHLOSFLAG_SEESS | ! MECHLOSFLAG_BLOCK); #endif return 0; } ! losflag = CalculateLOSFlag(mech, NULL, map, x, y, 0, hexRange); ! return Sensor_CanSee(mech, NULL, &losflag, arc, hexRange, map->mapvis, ! map->maplight, map->cloudbase); } Index: mech.move.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.move.c,v retrieving revision 1.5.2.15 retrieving revision 1.5.2.16 diff -C2 -d -r1.5.2.15 -r1.5.2.16 *** mech.move.c 3 Jun 2003 13:43:24 -0000 1.5.2.15 --- mech.move.c 30 Sep 2003 01:38:36 -0000 1.5.2.16 *************** *** 36,39 **** --- 36,41 ---- #include "p.template.h" #include "p.map.conditions.h" + #include "p.mech.fire.h" + #include "mech.events.h" struct { *************** *** 421,424 **** --- 423,427 ---- MechSpeed(mech) = 0; MechFloods(mech); + water_extinguish_inferno(mech); possible_mine_poof(mech, MINE_STEP); *************** *** 428,434 **** --- 431,439 ---- { MECH *mech = (MECH *) data; + char *args[2]; int wcDeadLegs = 0; int tNeedsPSkill = 1; int tDoStand = 1; + int bth, standanyway = 0; cch(MECH_USUAL); *************** *** 448,451 **** --- 453,472 ---- DOCHECK(MechCritStatus(mech) & GYRO_DESTROYED, "You cannot stand with a destroyed gyro!"); + + bth = MechPilotSkillRoll_BTH(mech, 0); + if (mech_parseattributes(buffer, args, 1)) { + switch (tolower(args[0][0])) { + case 'c': + notify(player, tprintf("Your BTH to stand would be: %d", bth)); + return; + case 'a': + standanyway = 1; + break; + default: + notify(player, tprintf("Unknown argument!" + "use 'stand check' or 'stand anyway'")); + break; + } + } DOCHECK(!Fallen(mech), "You're already standing!"); DOCHECK(Standrecovering(mech), *************** *** 454,457 **** --- 475,480 ---- DOCHECK(ChangingHulldown(mech), "You are busy changing your hulldown mode"); + DOCHECK(!standanyway && bth > 12, + "You would fail; use 'stand anyway' if you really want to stand."); MakeMechStand(mech); *************** *** 747,752 **** "Your cannot possibly control a VTOL going this fast with a destroyed tail rotor!"); DOCHECK(MechType(mech) == CLASS_MECH && ((MechZ(mech) < 0 && ! (MechRTerrain(mech) == WATER || MechRTerrain(mech) == BRIDGE)) ! || MechRTerrain(mech) == HIGHWATER), "You can't run through water!"); } --- 770,775 ---- "Your cannot possibly control a VTOL going this fast with a destroyed tail rotor!"); DOCHECK(MechType(mech) == CLASS_MECH && ((MechZ(mech) < 0 && ! (MechRTerrain(mech) == WATER || MechRTerrain(mech) == BRIDGE || ! MechRTerrain(mech) == ICE)) || MechRTerrain(mech) == HIGHWATER), "You can't run through water!"); } *************** *** 1348,1351 **** --- 1371,1375 ---- MechFloods(mech); + water_extinguish_inferno(mech); StopStaggerCheck(mech); } *************** *** 1535,1538 **** --- 1559,1563 ---- -1, 0, -1, 0, 0); MechFloods(mech); + water_extinguish_inferno(mech); } if (damage % 5) { *************** *** 1541,1544 **** --- 1566,1570 ---- (damage % 5), -1, -1, 0, -1, 0, 0); MechFloods(mech); + water_extinguish_inferno(mech); } Index: mech.notify.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.notify.c,v retrieving revision 1.3.2.11 retrieving revision 1.3.2.12 diff -C2 -d -r1.3.2.11 -r1.3.2.12 *** mech.notify.c 10 Dec 2002 13:50:54 -0000 1.3.2.11 --- mech.notify.c 30 Sep 2003 01:38:36 -0000 1.3.2.12 *************** *** 273,280 **** notify(player, buf); } ! if (IsLit3(mech)) { strcpy(buf + spaces, "%cg%chSEARCHLIGHT ON%cn"); notify(player, buf); ! } else if (IsLit2(mech)) { strcpy(buf + spaces, "%cg%chILLUMINATED%cn"); notify(player, buf); --- 273,280 ---- notify(player, buf); } ! if (MechLites(mech)) { strcpy(buf + spaces, "%cg%chSEARCHLIGHT ON%cn"); notify(player, buf); ! } else if (MechLit(mech)) { strcpy(buf + spaces, "%cg%chILLUMINATED%cn"); notify(player, buf); Index: mech.physical.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.physical.c,v retrieving revision 1.4.2.6 retrieving revision 1.4.2.7 diff -C2 -d -r1.4.2.6 -r1.4.2.7 *** mech.physical.c 2 Jun 2003 14:44:04 -0000 1.4.2.6 --- mech.physical.c 30 Sep 2003 01:38:36 -0000 1.4.2.7 *************** *** 670,673 **** --- 670,676 ---- "You can only punch vehicles while you're fallen"); + DOCHECKMA(MechTeam(target) == MechTeam(mech) && MechNoFriendlyFire(mech), + "You can't attack a teammate with FFSafeties on!"); + DOCHECKMA(MechType(target) == CLASS_MW && !MechPKiller(mech), "That's a living, breathing person! Switch off the safety first, " Index: mech.sensor.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.sensor.c,v retrieving revision 1.3.2.4 retrieving revision 1.3.2.5 diff -C2 -d -r1.3.2.4 -r1.3.2.5 *** mech.sensor.c 11 Dec 2002 12:45:55 -0000 1.3.2.4 --- mech.sensor.c 30 Sep 2003 01:38:36 -0000 1.3.2.5 *************** *** 351,355 **** MechNumSeen(mech) = MAX(0, MechNumSeen(mech) - 1); f &= ~MECHLOSFLAG_SEEN; ! if ((Started(target) || SeeWhenShutdown(target)) && (st = valid_to_notice(mech, target, wlf)) && seeanew < 3) { if (st & AUTOCON_WARN) --- 351,356 ---- MechNumSeen(mech) = MAX(0, MechNumSeen(mech) - 1); f &= ~MECHLOSFLAG_SEEN; ! if ((Started(target) || SeeWhenShutdown(target) || ! MechAutoconSD(mech)) && (st = valid_to_notice(mech, target, wlf)) && seeanew < 3) { if (st & AUTOCON_WARN) *************** *** 411,415 **** f |= MECHLOSFLAG_SEEN; *fl = f; ! if ((Started(target) || SeeWhenShutdown(target)) && (st = valid_to_notice(mech, target, -1)) && seeanew < 2) { if (st & AUTOCON_WARN) --- 412,417 ---- f |= MECHLOSFLAG_SEEN; *fl = f; ! if ((Started(target) || SeeWhenShutdown(target) || ! MechAutoconSD(mech)) && (st = valid_to_notice(mech, target, -1)) && seeanew < 2) { if (st & AUTOCON_WARN) Index: mech.sensor.functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.sensor.functions.c,v retrieving revision 1.1.1.1.2.7 retrieving revision 1.1.1.1.2.8 diff -C2 -d -r1.1.1.1.2.7 -r1.1.1.1.2.8 *** mech.sensor.functions.c 6 Jul 2002 20:41:03 -0000 1.1.1.1.2.7 --- mech.sensor.functions.c 30 Sep 2003 01:38:36 -0000 1.1.1.1.2.8 *************** *** 46,51 **** /* Prior requirement: the seechance > 0. We assume it so, and only examine the flag. */ - #define wood_count(a) (((a / MECHLOSFLAG_WOOD) % MECHLOSMAX_WOOD)) - #define water_count(a) (((a / MECHLOSFLAG_WATER) % MECHLOSMAX_WATER)) extern float ActualElevation(MAP * map, int x, int y, MECH * mech); --- 46,49 ---- *************** *** 54,70 **** CSEEFUNC(vislight_csee, !(map->sensorflags & (1 << SENSOR_VIS)) && !(f & (MECHLOSFLAG_BLOCK | MECHLOSFLAG_FIRE | MECHLOSFLAG_SMOKE)) && ! wood_count(f) < 3 && (!t || MechZ(t) >= 0 || ActualElevation(getMap(t->mapindex), MechX(t), MechY(t), t) >= 0.0 ! || water_count(f) < 6)); /* Liteamp doesn't see into water, thanks to reflections etc */ CSEEFUNC(liteamp_csee, !(map->sensorflags & (1 << SENSOR_LA)) && !(f & (MECHLOSFLAG_BLOCK | MECHLOSFLAG_FIRE | MECHLOSFLAG_SMOKE)) && ! (!t || !IsLit(t)) && wood_count(f) < 2 && !(water_count(f))); /* Not too good with woods, infra.. too much variation in temperature */ CSEEFUNC(infrared_csee, !(map->sensorflags & (1 << SENSOR_IR)) && !(f & (MECHLOSFLAG_BLOCK | MECHLOSFLAG_FIRE)) && ! wood_count(f) < 6 && (!t || (MechType(t) != CLASS_BSUIT && MechType(t) != CLASS_MW))); --- 52,68 ---- CSEEFUNC(vislight_csee, !(map->sensorflags & (1 << SENSOR_VIS)) && !(f & (MECHLOSFLAG_BLOCK | MECHLOSFLAG_FIRE | MECHLOSFLAG_SMOKE)) && ! MechLOSFlag_WoodCount(f) < 3 && (!t || MechZ(t) >= 0 || ActualElevation(getMap(t->mapindex), MechX(t), MechY(t), t) >= 0.0 ! || MechLOSFlag_WaterCount(f) < 6)); /* Liteamp doesn't see into water, thanks to reflections etc */ CSEEFUNC(liteamp_csee, !(map->sensorflags & (1 << SENSOR_LA)) && !(f & (MECHLOSFLAG_BLOCK | MECHLOSFLAG_FIRE | MECHLOSFLAG_SMOKE)) && ! (!t || !IsLit(t)) && MechLOSFlag_WoodCount(f) < 2 && !(MechLOSFlag_WaterCount(f))); /* Not too good with woods, infra.. too much variation in temperature */ CSEEFUNC(infrared_csee, !(map->sensorflags & (1 << SENSOR_IR)) && !(f & (MECHLOSFLAG_BLOCK | MECHLOSFLAG_FIRE)) && ! MechLOSFlag_WoodCount(f) < 6 && (!t || (MechType(t) != CLASS_BSUIT && MechType(t) != CLASS_MW))); *************** *** 73,77 **** CSEEFUNC(electrom_csee, !(map->sensorflags & (1 << SENSOR_EM)) && !(f & (MECHLOSFLAG_BLOCK | MECHLOSFLAG_MNTN)) && ! wood_count(f) < 8 && !AnyECMDisturbed(m) && (!t || (MechType(t) != CLASS_MW))); --- 71,75 ---- CSEEFUNC(electrom_csee, !(map->sensorflags & (1 << SENSOR_EM)) && !(f & (MECHLOSFLAG_BLOCK | MECHLOSFLAG_MNTN)) && ! MechLOSFlag_WoodCount(f) < 8 && !AnyECMDisturbed(m) && (!t || (MechType(t) != CLASS_MW))); *************** *** 119,123 **** #define MOVE_MODIFIER(a) (abs(a) >= 10.75 ? 1 : 0) ! #define nwood_count(mech,a) (((a / MECHLOSFLAG_WOOD) % MECHLOSMAX_WOOD) + \ ((MechElevation(mech) + 2) < MechZ(mech) ? 0 : \ MechRTerrain(mech) == LIGHT_FOREST ? 1 : \ --- 117,121 ---- #define MOVE_MODIFIER(a) (abs(a) >= 10.75 ? 1 : 0) ! #define nwood_count(mech,a) (MechLOSFlag_WoodCount(a) + \ ((MechElevation(mech) + 2) < MechZ(mech) ? 0 : \ MechRTerrain(mech) == LIGHT_FOREST ? 1 : \ Index: mech.update.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.update.c,v retrieving revision 1.5.2.16 retrieving revision 1.5.2.17 diff -C2 -d -r1.5.2.16 -r1.5.2.17 *** mech.update.c 4 Jun 2003 21:07:04 -0000 1.5.2.16 --- mech.update.c 30 Sep 2003 01:38:36 -0000 1.5.2.17 *************** *** 441,444 **** --- 441,445 ---- MarkForLOSUpdate(mech); MechFloods(mech); + water_extinguish_inferno(mech); steppable_base_check(mech, x, y); if (MechChargeTarget(mech) > 0 && mudconf.btech_newcharge) *************** *** 1232,1236 **** int elevation, lastelevation; int oldterrain; ! int ot, le, ed, done = 0, tt; float f; --- 1233,1237 ---- int elevation, lastelevation; int oldterrain; ! int ot, le, ed, done = 0, tt, avoidbth; float f; *************** *** 1328,1337 **** mech_notify(mech, MECHALL, "You notice a large drop in front of you"); ! if (MechPilot(mech) == -1 || (!mudconf.btech_skidcliff && ! MadePilotSkillRoll(mech, ! (int) (fabs((MechSpeed(mech)) + MP1) / MP1) / 3)) ! || (mudconf.btech_skidcliff && ! MadePilotSkillRoll(mech, ! SkidMod(fabs(MechSpeed(mech)) / MP1)))) { mech_notify(mech, MECHALL, "You manage to stop before falling off."); --- 1329,1337 ---- mech_notify(mech, MECHALL, "You notice a large drop in front of you"); ! avoidbth = mudconf.btech_skidcliff ? ! SkidMod(fabs(MechSpeed(mech)) / MP1) : ! ((fabs((MechSpeed(mech)) + MP1) / MP1) / 3); ! if (MechPilot(mech) == -1 || (!MechAutoFall(mech) && ! MadePilotSkillRoll(mech, avoidbth))) { mech_notify(mech, MECHALL, "You manage to stop before falling off."); *************** *** 1461,1470 **** mech_notify(mech, MECHALL, "You notice a large drop in front of you"); ! if (MechPilot(mech) == -1 || (!mudconf.btech_skidcliff && ! MadePilotSkillRoll(mech, ! (int) (fabs((MechSpeed(mech)) + MP1) / MP1) / 3)) ! || (mudconf.btech_skidcliff && ! MadePilotSkillRoll(mech, ! SkidMod(fabs(MechSpeed(mech)) / MP1)))) { mech_notify(mech, MECHALL, "You manage to stop before falling off."); --- 1461,1469 ---- mech_notify(mech, MECHALL, "You notice a large drop in front of you"); ! avoidbth = mudconf.btech_skidcliff ? ! SkidMod(fabs(MechSpeed(mech)) / MP1) : ! ((fabs((MechSpeed(mech)) + MP1) / MP1) / 3); ! if (MechPilot(mech) == -1 || (!MechAutoFall(mech) && ! MadePilotSkillRoll(mech, avoidbth))) { mech_notify(mech, MECHALL, "You manage to stop before falling off."); *************** *** 1588,1597 **** mech_notify(mech, MECHALL, "You notice a large drop in front of you"); ! if (MechPilot(mech) == -1 || (!mudconf.btech_skidcliff && ! MadePilotSkillRoll(mech, ! (int) (fabs((MechSpeed(mech)) + MP1) / MP1) / 3)) ! || (mudconf.btech_skidcliff && ! MadePilotSkillRoll(mech, ! SkidMod(fabs(MechSpeed(mech)) / MP1)))) { mech_notify(mech, MECHALL, "You manage to stop before falling off."); --- 1587,1595 ---- mech_notify(mech, MECHALL, "You notice a large drop in front of you"); ! avoidbth = mudconf.btech_skidcliff ? ! SkidMod(fabs(MechSpeed(mech)) / MP1) : ! ((fabs((MechSpeed(mech)) + MP1) / MP1) / 3); ! if (MechPilot(mech) == -1 || (!MechAutoFall(mech) && ! MadePilotSkillRoll(mech, avoidbth))) { mech_notify(mech, MECHALL, "You manage to stop before falling off."); *************** *** 1771,1780 **** mech_notify(mech, MECHALL, "You notice a large drop in front of you"); ! if (MechPilot(mech) == -1 || (!mudconf.btech_skidcliff && ! MadePilotSkillRoll(mech, ! (int) (fabs((MechSpeed(mech)) + MP1) / MP1) / 3)) ! || (mudconf.btech_skidcliff && ! MadePilotSkillRoll(mech, ! SkidMod(fabs(MechSpeed(mech)) / MP1)))) { mech_notify(mech, MECHALL, "You manage to stop before falling off."); --- 1769,1777 ---- mech_notify(mech, MECHALL, "You notice a large drop in front of you"); ! avoidbth = mudconf.btech_skidcliff ? ! SkidMod(fabs(MechSpeed(mech)) / MP1) : ! ((fabs((MechSpeed(mech)) + MP1) / MP1) / 3); ! if (MechPilot(mech) == -1 || (!MechAutoFall(mech) && ! MadePilotSkillRoll(mech, avoidbth))) { mech_notify(mech, MECHALL, "You manage to stop before falling off."); Index: mech.utils.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/mech.utils.c,v retrieving revision 1.9.2.17 retrieving revision 1.9.2.18 diff -C2 -d -r1.9.2.17 -r1.9.2.18 *** mech.utils.c 3 Jun 2003 12:54:42 -0000 1.9.2.17 --- mech.utils.c 30 Sep 2003 01:38:36 -0000 1.9.2.18 *************** *** 529,532 **** --- 529,541 ---- } + int MechPilotSkillRoll_BTH(MECH *mech, int mods) + { + mods += FindSPilotPiloting(mech) + MechPilotSkillBase(mech); + if (In_Character(mech->mynum) && + Location(MechPilot(mech)) != mech->mynum) + mods += 5; + return mods; + } + int MadePilotSkillRoll_Advanced(MECH * mech, int mods, int succeedWhenFallen) *************** *** 539,552 **** return 0; roll = PRoll(mech); ! roll_needed = ! FindSPilotPiloting(mech) + mods + MechPilotSkillBase(mech); ! SendDebug(tprintf ! ("Attempting to make pilot skill roll. SPilot: %d, mods: %d, MechPilot: %d", ! FindSPilotPiloting(mech), mods, MechPilotSkillBase(mech))); - if (In_Character(mech->mynum) && - Location(MechPilot(mech)) != mech->mynum) - roll_needed += 5; mech_notify(mech, MECHPILOT, "You make a piloting skill roll!"); mech_notify(mech, MECHPILOT, --- 548,558 ---- return 0; roll = PRoll(mech); ! roll_needed = MechPilotSkillRoll_BTH(mech, mods); ! SendDebug(tprintf("Attempting to make pilot skill roll. " ! "SPilot: %d, mods: %d, MechPilot: %d, BTH: %d", ! FindSPilotPiloting(mech), mods, ! MechPilotSkillBase(mech), roll_needed)); mech_notify(mech, MECHPILOT, "You make a piloting skill roll!"); mech_notify(mech, MECHPILOT, Index: p.map.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/p.map.h,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -C2 -d -r1.1.1.1.2.2 -r1.1.1.1.2.3 *** p.map.h 4 Apr 2002 13:13:09 -0000 1.1.1.1.2.2 --- p.map.h 30 Sep 2003 01:38:36 -0000 1.1.1.1.2.3 *************** *** 19,22 **** --- 19,23 ---- void map_mapemit(dbref player, void *data, char *buffer); int water_distance(MAP * map, int x, int y, int dir, int max); + int map_load(MAP * map, char * mapname); void map_loadmap(dbref player, void *data, char *buffer); void map_savemap(dbref player, void *data, char *buffer); Index: p.mech.advanced.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/p.mech.advanced.h,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** p.mech.advanced.h 18 Mar 2002 22:31:41 -0000 1.1.1.1.2.1 --- p.mech.advanced.h 30 Sep 2003 01:38:36 -0000 1.1.1.1.2.2 *************** *** 61,64 **** --- 61,65 ---- void mech_usebin(dbref player, MECH * mech, char *buffer); void mech_safety(dbref player, void *data, char *buffer); + void mech_mechprefs(dbref player, void *data, char *buffer); #endif /* _P_MECH_ADVANCED_H */ Index: p.mech.fire.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/p.mech.fire.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** p.mech.fire.h 1 Feb 2002 15:02:13 -0000 1.2 --- p.mech.fire.h 30 Sep 2003 01:38:36 -0000 1.2.2.1 *************** *** 9,10 **** --- 9,11 ---- void vehicle_extinquish_fire_event(EVENT * e); void vehicle_extinquish_fire(dbref player, MECH * mech, char *buffer); + void water_extinguish_inferno(MECH * mech); Index: p.mech.utils.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/p.mech.utils.h,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** p.mech.utils.h 21 Jul 2002 21:21:44 -0000 1.2.2.3 --- p.mech.utils.h 30 Sep 2003 01:38:36 -0000 1.2.2.4 *************** *** 36,39 **** --- 36,40 ---- int FindTechSkill(dbref player, MECH * mech); int MadePilotSkillRoll(MECH * mech, int mods); + int MechPilotSkillRoll_BTH(MECH *mech, int mods); int MadePilotSkillRoll_Advanced(MECH * mech, int mods, int succeedWhenFallen); Index: weapons.fasa.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/btech/weapons.fasa.h,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** weapons.fasa.h 12 Jul 2002 19:23:32 -0000 1.3.2.1 --- weapons.fasa.h 30 Sep 2003 01:38:36 -0000 1.3.2.2 *************** *** 1,348 **** - /* ! * $Id$ ! * ! * Last modified: $Date$ ! * ! * Header file for official FASA weapons with official FASA stats. */ ! ! ! struct weapon_struct MechWeapons[] = { ! ! {"CL.AC/10", 30, TAMMO, 3, 10, 0, 5, 10, 15, 0, -1, -1, -1, 6, 10, ! 1100, -1, CLAT | RFAC, 124}, ! {"CL.AC/2", 30, TAMMO, 1, 2, 4, 8, 16, 24, 0, -1, -1, -1, 1, 45, 500, ! -1, CLAT | RFAC, 37}, ! {"CL.AC/20", 30, TAMMO, 7, 20, 0, 3, 6, 9, 0, -1, -1, -1, 9, 5, 1300, ! -1, CLAT | RFAC, 178}, ! {"CL.AC/5", 30, TAMMO, 1, 5, 3, 6, 12, 18, 0, -1, -1, -1, 3, 20, 700, ! -1, CLAT | RFAC, 70}, ! {"CL.A-Pod", 30, TBEAM, 0, 0, 0, 1, 1, 1, 0, -1, -1, -1, 1, 0, 50, -1, ! CLAT | A_POD, 1}, ! {"CL.Anti-MissileSystem", 10, TMISSILE, 1, 2, 0, 1, 1, 1, 0, -1, -1, ! -1, 1, 24, 50, -1, CLAT | AMS, 63}, ! {"CL.ArrowIVSystem", 60, TARTILLERY, 10, 20, 0, 0, 0, 6, 0, -1, -1, -1, ! 12, 5, 1200, -1, IDF | DAR | CLAT, 171}, ! {"CL.GaussRifle", 30, TAMMO, 1, 15, 2, 7, 15, 22, 0, -1, -1, -1, 6, 8, ! 1200, 20, GAUSS | CLAT, 321}, ! {"CL.LB10-XAC", 30, TAMMO, 2, 10, 0, 6, 12, 18, 0, -1, -1, -1, 5, 10, ! 1000, -1, LBX | CLAT, 148}, ! {"CL.LB2-XAC", 30, TAMMO, 1, 2, 4, 10, 20, 30, 0, -1, -1, -1, 3, 45, ! 500, -1, LBX | CLAT, 47}, ! {"CL.LB20-XAC", 30, TAMMO, 6, 20, 0, 4, 8, 12, 0, -1, -1, -1, 9, 5, ! 1200, -1, LBX | CLAT, 237}, ! {"CL.LB5-XAC", 30, TAMMO, 1, 5, 3, 8, 15, 24, 0, -1, -1, -1, 4, 20, ! 700, -1, LBX | CLAT, 93}, ! {"CL.LRM-10", 30, TMISSILE, 4, 1, 0, 7, 14, 21, 0, -1, -1, -1, 1, 12, ! 250, -1, IDF | CLAT, 109}, ! {"CL.LRM-15", 30, TMISSILE, 5, 1, 0, 7, 14, 21, 0, -1, -1, -1, 2, 8, ! 350, -1, IDF | CLAT, 164}, ! {"CL.LRM-20", 30, TMISSILE, 6, 1, 0, 7, 14, 21, 0, -1, -1, -1, 4, 6, ! 500, -1, IDF | CLAT, 220}, ! {"CL.LRM-5", 30, TMISSILE, 2, 1, 0, 7, 14, 21, 0, -1, -1, -1, 1, 24, ! 100, -1, IDF | CLAT, 55}, ! {"CL.MachineGun", 30, TAMMO, 0, 2, 0, 1, 2, 3, 0, -1, -1, -1, 1, 200, ! 25, -1, CLAT | GMG, 5}, ! {"CL.NarcBeacon", 30, TMISSILE, 1, 4, 0, 4, 8, 12, 0, -1, -1, -1, 1, 6, ! 200, -1, NARC | CLAT, 30}, ! {"CL.SRM-2", 30, TMISSILE, 2, 2, 0, 3, 6, 9, 0, -1, -1, -1, 1, 50, 50, ! -1, CLAT, 21}, ! {"CL.SRM-4", 30, TMISSILE, 3, 2, 0, 3, 6, 9, 0, -1, -1, -1, 1, 25, 100, ! -1, CLAT, 39}, ! {"CL.SRM-6", 30, TMISSILE, 4, 2, 0, 3, 6, 9, 0, -1, -1, -1, 1, 15, 150, ! -1, CLAT, 59}, ! {"CL.StreakSRM-2", 30, TMISSILE, 2, 2, 0, 4, 8, 12, 0, -1, -1, -1, 1, ! 50, 100, -1, STREAK | CLAT | NOSPA, 40}, ! {"CL.StreakSRM-4", 30, TMISSILE, 3, 2, 0, 4, 8, 12, 0, -1, -1, -1, 1, ! 25, 200, -1, STREAK | CLAT | NOSPA, 79}, ! {"CL.StreakSRM-6", 30, TMISSILE, 4, 2, 0, 4, 8, 12, 0, -1, -1, -1, 2, ! 15, 300, -1, STREAK | CLAT | NOSPA, 119}, ! {"CL.UltraAC/10", 30, TAMMO, 3, 10, 0, 6, 12, 18, 0, -1, -1, -1, 4, 10, ! 1000, -1, ULTRA | CLAT, 211}, ! {"CL.UltraAC/2", 30, TAMMO, 1, 2, 2, 9, 18, 27, 0, -1, -1, -1, 2, 45, ! 500, -1, ULTRA | CLAT, 62}, ! {"CL.UltraAC/20", 30, TAMMO, 7, 20, 0, 4, 8, 12, 0, -1, -1, -1, 8, 5, ! 1200, -1, ULTRA | CLAT, 337}, ! {"CL.UltraAC/5", 30, TAMMO, 1, 5, 0, 7, 14, 21, 0, -1, -1, -1, 3, 20, ! 700, -1, ULTRA | CLAT, 123}, ! {"IS.AC/10", 30, TAMMO, 3, 10, 0, 5, 10, 15, 0, -1, -1, -1, 7, 10, ! 1200, -1, RFAC, 124}, ! {"IS.AC/2", 30, TAMMO, 1, 2, 4, 8, 16, 24, 0, -1, -1, -1, 1, 45, 600, ! -1, RFAC, 37}, ! {"IS.AC/20", 30, TAMMO, 7, 20, 0, 3, 6, 9, 0, -1, -1, -1, 10, 5, 1400, ! -1, RFAC, 178}, ! {"IS.AC/5", 30, TAMMO, 1, 5, 3, 6, 12, 18, 0, -1, -1, -1, 4, 20, 800, ! -1, RFAC, 70}, ! {"IS.Anti-MissileSystem", 10, TMISSILE, 1, 2, 0, 1, 1, 1, 0, -1, -1, ! -1, 1, 12, 50, -1, AMS, 32}, ! {"IS.ArrowIVSystem", 60, TARTILLERY, 10, 20, 0, 0, 0, 5, 0, -1, -1, -1, ! 15, 5, 1500, -1, IDF | DAR, 171}, ! {"IS.GaussRifle", 30, TAMMO, 1, 15, 2, 7, 15, 22, 0, -1, -1, -1, 7, 8, ! 1500, 20, GAUSS, 321}, ! {"IS.LB10-XAC", 30, TAMMO, 2, 10, 0, 6, 12, 18, 0, -1, -1, -1, 6, 10, ! 1100, -1, LBX, 148}, ! {"IS.LRM-10", 30, TMISSILE, 4, 1, 6, 7, 14, 21, 0, -1, -1, -1, 2, 12, ! 500, -1, IDF, 90}, ! {"IS.LRM-15", 30, TMISSILE, 5, 1, 6, 7, 14, 21, 0, -1, -1, -1, 3, 8, ! 700, -1, IDF, 136}, ! {"IS.LRM-20", 30, TMISSILE, 6, 1, 6, 7, 14, 21, 0, -1, -1, -1, 5, 6, ! 1000, -1, IDF, 181}, ! {"IS.LRM-5", 30, TMISSILE, 2, 1, 6, 7, 14, 21, 0, -1, -1, -1, 1, 24, ! 200, -1, IDF, 45}, ! {"IS.LongTom", 60, TARTILLERY, 20, 20, 0, 0, 0, 20, 0, -1, -1, -1, 30, ! 5, 3000, -1, IDF | DAR, 171}, ! {"IS.MachineGun", 30, TAMMO, 0, 2, 0, 1, 2, 3, 0, -1, -1, -1, 1, 200, ! 50, -1, GMG, 5}, ! {"IS.NarcBeacon", 30, TMISSILE, 1, 4, 0, 3, 6, 9, 0, -1, -1, -1, 2, 6, ! 300, -1, NARC, 30}, ! {"IS.SRM-2", 30, TMISSILE, 2, 2, 0, 3, 6, 9, 0, -1, -1, -1, 1, 50, 100, ! -1, NONE, 21}, ! {"IS.SRM-4", 30, TMISSILE, 3, 2, 0, 3, 6, 9, 0, -1, -1, -1, 1, 25, 200, ! -1, NONE, 39}, ! {"IS.SRM-6", 30, TMISSILE, 4, 2, 0, 3, 6, 9, 0, -1, -1, -1, 2, 15, 300, ! -1, NONE, 59}, ! {"IS.Sniper", 60, TARTILLERY, 10, 10, 0, 0, 0, 12, 0, -1, -1, -1, 20, ! 10, 2000, -1, IDF | DAR, 86}, ! {"IS.StreakSRM-2", 30, TMISSILE, 2, 2, 0, 3, 6, 9, 0, -1, -1, -1, 1, ! 50, 150, -1, STREAK | NOSPA, 30}, ! {"IS.Thumper", 60, TARTILLERY, 6, 5, 0, 0, 0, 14, 0, -1, -1, -1, 15, ! 20, 1500, -1, IDF | DAR, 40}, ! {"IS.UltraAC/5", 30, TAMMO, 1, 5, 2, 6, 13, 20, 0, -1, -1, -1, 5, 20, ! 900, -1, ULTRA, 113}, ! {"PC.Blazer", 10, TAMMO, 0, 32, 0, 24, 48, 72, 0, -1, -1, -1, 1, 30, 0, ! -1, PC_HEAT, 1}, ! {"PC.Crossbow", 15, TAMMO, 0, 9, 0, 9, 18, 27, 0, -1, -1, -1, 1, 20, 0, ! -1, PC_IMPA | NOBOOM, 1}, ! {"PC.FederatedLongRifle", 10, TAMMO, 0, 9, 0, 22, 44, 66, 0, -1, -1, ! -1, 1, 50, 0, -1, PC_IMPA, 1}, ! {"PC.FlamerPistol", 7, TAMMO, 0, 7, 0, 4, 9, 13, 0, -1, -1, -1, 1, 50, ! 0, -1, PC_HEAT, 1}, ! {"PC.GyroslugRifle", 10, TAMMO, 0, 14, 0, 30, 60, 90, 0, -1, -1, -1, 1, ! 15, 0, -1, PC_IMPA, 1}, ! {"PC.HeavyGyrojetGun", 10, TAMMO, 0, 27, 0, 35, 70, 105, 0, -1, -1, -1, ! 1, 10, 0, -1, PC_IMPA, 1}, ! {"PC.IntekLaserRifle", 10, TAMMO, 0, 9, 0, 40, 80, 120, 0, -1, -1, -1, ! 1, 45, 0, -1, PC_HEAT | NOBOOM, 1}, ! {"PC.LaserRifle", 10, TAMMO, 0, 17, 0, 24, 48, 72, 0, -1, -1, -1, 1, ! 30, 0, -1, PC_HEAT | NOBOOM, 1}, ! {"PC.PulseLaserPistol", 10, TAMMO, 0, 11, 0, 5, 10, 15, 0, -1, -1, -1, ! 1, 50, 0, -1, PC_HEAT | NOBOOM, 1}, ! {"PC.PulseLaserRifle", 10, TAMMO, 0, 13, 0, 22, 44, 66, 0, -1, -1, -1, ! 1, 30, 0, -1, PC_HEAT | NOBOOM, 1}, ! {"PC.SMG", 5, TAMMO, 0, 10, 0, 7, 14, 20, 0, -1, -1, -1, 1, 50, 0, ! -1, PC_IMPA, 1}, ! {"PC.Shotgun", 15, TAMMO, 0, 12, 0, 6, 12, 18, 0, -1, -1, -1, 1, 10, 0, ! -1, PC_IMPA, 1}, ! {"PC.SternsnachtPistol", 10, TAMMO, 0, 16, 0, 7, 14, 20, 0, -1, -1, -1, ! 1, 50, 0, -1, PC_IMPA, 1}, ! {"PC.SunbeamLaserPistol", 7, TAMMO, 0, 18, 0, 8, 16, 24, 0, -1, -1, -1, ! 1, 50, 0, -1, PC_HEAT | NOBOOM, 1}, ! {"PC.ZeusHeavyRifle", 10, TAMMO, 0, 21, 0, 19, 38, 57, 0, -1, -1, -1, ! 1, 30, 0, -1, PC_IMPA, 1}, ! ! /* TacMunch stuff */ ! ! ! {"IS.ELRM-5", 30, TMISSILE, 3, 1, 10, 12, 24, 36, 0, -1, -1, -1, 1, ! 18, 600, -1, IDF | ELRM | NOSPA, 1000}, ! {"IS.ELRM-10", 30, TMISSILE, 6, 1, 10, 12, 24, 36, 0, -1, -1, -1, 4, 9, ! 800, -1, IDF | ELRM | NOSPA, 1000}, ! {"IS.ELRM-15", 30, TMISSILE, 8, 1, 10, 12, 24, 36, 0, -1, -1, -1, 6, 6, ! 1200, -1, IDF | ELRM | NOSPA, 1000}, ! {"IS.ELRM-20", 30, TMISSILE, 10, 1, 10, 12, 24, 36, 0, -1, -1, -1, 8, ! 4, 1800, -1, IDF | ELRM | NOSPA, 1000}, ! {"IS.LR_DFM-5", 30, TMISSILE, 2, 2, 4, 6, 12, 18, 0, -1, -1, -1, 1, 24, ! 200, -1, IDF | DFM | NOSPA, 1000}, ! {"IS.LR_DFM-10", 30, TMISSILE, 4, 2, 4, 6, 12, 18, 0, -1, -1, -1, 2, ! 12, 500, -1, IDF | DFM | NOSPA, 1000}, ! {"IS.LR_DFM-15", 30, TMISSILE, 5, 2, 4, 6, 12, 18, 0, -1, -1, -1, 3, 8, ! 700, -1, IDF | DFM | NOSPA, 1000}, ! {"IS.LR_DFM-20", 30, TMISSILE, 6, 2, 4, 6, 12, 18, 0, -1, -1, -1, 5, 6, ! 1000, -1, IDF | DFM | NOSPA, 1000}, ! {"IS.SR_DFM-2", 30, TMISSILE, 2, 3, 0, 2, 4, 6, 0, -1, -1, -1, 1, 50, ! 100, -1, DFM | NOSPA, 1000}, ! {"IS.SR_DFM-4", 30, TMISSILE, 3, 3, 0, 2, 4, 6, 0, -1, -1, -1, 1, 25, ! 200, -1, DFM | NOSPA, 1000}, ! {"IS.SR_DFM-6", 30, TMISSILE, 4, 3, 0, 2, 4, 6, 0, -1, -1, -1, 2, 15, ! 300, -1, DFM | NOSPA, 1000}, ! {"IS.StreakSRM-4", 30, TMISSILE, 3, 2, 0, 3, 6, 9, -1, -1, -1, 9, 1, ! 25, 300, -1, STREAK | NOSPA, 59}, ! {"IS.StreakSRM-6", 30, TMISSILE, 4, 2, 0, 3, 6, 9, -1, -1, -1, 9, 2, ! 15, 450, -1, STREAK | NOSPA, 89}, ! {"IS.Thunderbolt-5", 30, TMISSILE, 3, 5, 5, 6, 12, 18, 0, -1, -1, -1, ! 1, 12, 300, -1, IDF | NOSPA, 1000}, ! {"IS.Thunderbolt-10", 30, TMISSILE, 5, 10, 5, 6, 12, 18, 0, -1, -1, -1, ! 2, 6, 600, -1, IDF | NOSPA, 1000}, ! {"IS.Thunderbolt-15", 30, TMISSILE, 7, 15, 5, 6, 12, 18, 0, -1, -1, -1, ! 3, 4, 800, -1, IDF | NOSPA, 1000}, ! {"IS.Thunderbolt-20", 30, TMISSILE, 8, 20, 5, 6, 12, 18, 0, -1, -1, -1, ! 5, 3, 1100, -1, IDF | NOSPA, 1000}, ! {"IS.CaselessAC/2", 30, TAMMO, 1, 2, 4, 8, 16, 24, 0, -1, -1, -1, 1, ! 67, 600, -1, NOSPA | CASELESS, 1000}, ! {"IS.CaselessAC/5", 30, TAMMO, 1, 5, 3, 6, 12, 18, 0, -1, -1, -1, 4, ! 30, 800, -1, NOSPA | CASELESS, 1000}, ! {"IS.CaselessAC/10", 30, TAMMO, 3, 10, 0, 5, 10, 15, 0, -1, -1, -1, 6, ! 15, 1200, -1, NOSPA | CASELESS, 1000}, ! {"IS.CaselessAC/20", 30, TAMMO, 7, 20, 0, 3, 6, 9, 9, 0, -1, -1, -1, 8, ! 1400, -1, NOSPA | CASELESS, 1000}, ! {"IS.HyperAC/2", 30, TAMMO, 1, 2, 3, 10, 20, 35, 0, -1, -1, -1, 4, 30, ! 800, -1, NOSPA | HYPER, 1000}, ! {"IS.HyperAC/5", 30, TAMMO, 3, 5, 0, 8, 16, 28, 0, -1, -1, -1, 5, 15, ! 1200, -1, NOSPA | HYPER, 1000}, ! {"IS.HyperAC/10", 30, TAMMO, 7, 10, 0, 6, 12, 20, 0, -1, -1, -1, 6, 8, ! 1400, -1, NOSPA | HYPER, 1000}, ! {"IS.LB2-XAC", 30, TAMMO, 1, 2, 4, 9, 18, 27, 0, -1, -1, -1, 4, 45, ! 600, -1, LBX, 42}, ! {"IS.LB5-XAC", 30, TAMMO, 1, 5, 3, 7, 14, 21, 0, -1, -1, -1, 5, 20, ! 800, -1, LBX, 83}, ! {"IS.LB20-XAC", 30, TAMMO, 6, 20, 0, 4, 8, 12, 0, -1, -1, -1, 11, 5, ! 1400, -1, LBX, 237}, ! {"IS.UltraAC/2", 30, TAMMO, 1, 2, 4, 8, 17, 25, 0, -1, -1, -1, 3, 45, ! 700, -1, ULTRA, 56}, ! {"IS.UltraAC/10", 30, TAMMO, 4, 10, 0, 6, 12, 18, 0, -1, -1, -1, 7, 10, ! 1300, -1, ULTRA, 253}, ! {"IS.UltraAC/20", 30, TAMMO, 8, 20, 0, 3, 7, 10, 0, -1, -1, -1, 10, 5, ! 1500, -1, ULTRA, 282}, ! ! /* DCMS stuff */ ! ! ! {"IS.MRM-10", 30, TMISSILE, 4, 1, 0, 3, 8, 15, 0, -1, -1, -1, 2, ! 24, 300, -1, MRM, 56}, ! {"IS.MRM-20", 30, TMISSILE, 6, 1, 0, 3, 8, 15, 0, -1, -1, -1, 3, 12, ! 700, -1, MRM, 112}, ! {"IS.MRM-30", 30, TMISSILE, 10, 1, 0, 3, 8, 15, 0, -1, -1, -1, 5, 8, ! 1000, -1, MRM, 168}, ! {"IS.MRM-40", 30, TMISSILE, 12, 1, 0, 3, 8, 15, 0, -1, -1, -1, 7, 6, ! 1200, -1, MRM, 224}, ! ! /* .. normal cont'd ; energy weapons .. */ ! ! ! {"CL.ERLargeLaser", 30, TBEAM, 12, 10, 0, 8, 15, 25, 0, 5, 10, 15, ! 1, 0, 400, -1, CLAT, 249}, ! {"CL.ERMediumLaser", 30, TBEAM, 5, 7, 0, 5, 10, 15, 0, 3, 7, 10, 1, 0, ! 100, -1, CLAT, 108}, ! {"CL.ERPPC", 30, TBEAM, 15, 15, 0, 7, 14, 23, 0, 4, 10, 16, 2, 0, 600, ! -1, CLAT, 412}, ! {"CL.ERSmallLaser", 30, TBEAM, 2, 5, 0, 2, 4, 6, 0, 1, 2, 4, 1, 0, 50, ! -1, CLAT, 31}, ! {"CL.Flamer", 30, TBEAM, 3, 2, 0, 1, 2, 3, 0, -1, -1, -1, 1, 0, 50, ! -1, CLAT | CHEAT, 6}, ! {"CL.LargeLaser", 30, TBEAM, 8, 8, 0, 5, 10, 15, 0, 3, 6, 9, 1, 0, 400, ! -1, CLAT, 124}, ! {"CL.LargePulseLaser", 30, TBEAM, 10, 10, 0, 6, 14, 20, 0, 4, 10, 14, ! 2, 0, 600, -1, PULSE | CLAT, 265}, ! {"CL.MediumLaser", 30, TBEAM, 3, 5, 0, 3, 6, 9, 0, 2, 4, 6, 1, 0, 100, ! -1, CLAT, 46}, ! {"CL.MediumPulseLaser", 30, TBEAM, 4, 7, 0, 4, 8, 12, 0, 3, 5, 8, 1, 0, ! 200, -1, PULSE | CLAT, 111}, ! {"CL.PPC", 30, TBEAM, 10, 10, 3, 6, 12, 18, 3, 4, 7, 10, 2, 0, 600, ! -1, CLAT, 176}, ! {"CL.SmallLaser", 30, TBEAM, 1, 3, 0, 1, 2, 3, 0, 1, 2, -1, 1, 0, 50, ! -1, CLAT, 9}, ! {"CL.SmallPulseLaser", 30, TBEAM, 2, 3, 0, 2, 4, 6, 0, 1, 2, 4, 1, 0, ! 100, -1, PULSE | CLAT, 24}, ! {"IS.ERLargeLaser", 30, TBEAM, 12, 8, 0, 7, 14, 19, 0,... [truncated message content] |
From: Thomas W. <two...@us...> - 2003-09-30 01:38:41
|
Update of /cvsroot/btech/btechmux/event In directory sc8-pr-cvs1:/tmp/cvs-serv2119/event Removed Files: Tag: btmux_1_4-branch .depend Makefile Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. --- .depend DELETED --- --- Makefile DELETED --- |
From: Thomas W. <two...@us...> - 2003-09-30 01:38:40
|
Update of /cvsroot/btech/btechmux/src/hcode/include In directory sc8-pr-cvs1:/tmp/cvs-serv2119/src/hcode/include Modified Files: Tag: btmux_1_4-branch glue.h Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. Index: glue.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/include/glue.h,v retrieving revision 1.4.2.6 retrieving revision 1.4.2.7 diff -C2 -d -r1.4.2.6 -r1.4.2.7 *** glue.h 2 Jun 2003 16:01:43 -0000 1.4.2.6 --- glue.h 30 Sep 2003 01:38:36 -0000 1.4.2.7 *************** *** 414,417 **** --- 414,419 ---- "Enable/Disable Safeties against killing MechWarriors.", mech_safety}, + {0, "MECHPREFS [SETTING]", "Toggle the mechpref setting of SETTING", + mech_mechprefs}, /* Vengy's pickup/dropoff */ |
From: Thomas W. <two...@us...> - 2003-09-30 01:38:40
|
Update of /cvsroot/btech/btechmux/misc In directory sc8-pr-cvs1:/tmp/cvs-serv2119/misc Removed Files: Tag: btmux_1_4-branch .depend Makefile Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. --- .depend DELETED --- --- Makefile DELETED --- |
From: Thomas W. <two...@us...> - 2003-09-30 01:38:39
|
Update of /cvsroot/btech/btechmux/src In directory sc8-pr-cvs1:/tmp/cvs-serv2119/src Modified Files: Tag: btmux_1_4-branch funceval.c functions.c wiz.c Removed Files: Tag: btmux_1_4-branch .depend Makefile.in configure configure.in Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. Index: funceval.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/funceval.c,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -C2 -d -r1.3.2.2 -r1.3.2.3 *** funceval.c 30 Jul 2002 20:29:48 -0000 1.3.2.2 --- funceval.c 30 Sep 2003 01:38:35 -0000 1.3.2.3 *************** *** 3334,3335 **** --- 3334,3430 ---- } } + + /* + * --------------------------------------------------------------------------- + * fun_setlock: Set lock from a function (like @lock) + */ + + extern NAMETAB lock_sw; + + FUNCTION(fun_setlock) + { + int switchkey = 0; + dbref thing, aowner; + int atr, aflags; + ATTR *ap; + struct boolexp *okey; + + if (*fargs[0]) { + switchkey = search_nametab(player, &lock_sw, fargs[0]); + if (switchkey < 0) { + safe_str("#-1 SWITCH ERROR", buff, bufc); + return; + } + } + + if (parse_attrib(player, fargs[1], &thing, &atr)) { + if (atr != NOTHING) { + if (!atr_get_info(thing, atr, &aowner, &aflags)) { + safe_str("#-1 ATTR NOT FOUND", buff, bufc); + return; + } + ap = atr_num(atr); + + /* + * You may lock an attribute iff: you could write the + * attribute if it were stored on yourself --and-- you own + * the attribute or are a wizard as long as you are not #1 + * and are trying to do something to #1. + */ + + if (ap && (God(player) || (!God(thing) && + (Set_attr(player, player, ap, 0) && (Wizard(player) + || aowner == Owner(player)))))) { + if (*fargs[2]) + aflags |= AF_LOCK; + else + aflags &= ~AF_LOCK; + atr_set_flags(thing, atr, aflags); + safe_str("1", buff, bufc); + } else { + safe_str("#-1 PERMISSION DENIED", buff, bufc); + } + return; + } + } + init_match(player, fargs[1], NOTYPE); + match_everything(MAT_EXIT_PARENTS); + thing = match_result(); + + switch (thing) { + case NOTHING: + safe_str("#-1 NOT FOUND", buff, bufc); + return; + case AMBIGUOUS: + safe_str("#-1 AMBIGUOUS MATCH", buff, bufc); + return; + default: + if (!controls(player, thing)) { + safe_str("#-1 PERMISSION DENIED", buff, bufc); + return; + } + } + + if (!switchkey) + switchkey = A_LOCK; + + if (!*fargs[2]) { + atr_clr(thing, switchkey); + safe_str("1", buff, bufc); + return; + } + + okey = parse_boolexp(player, fargs[2], 0); + if (okey == TRUE_BOOLEXP) { + safe_str("#-1 KEY ERROR", buff, bufc); + } else { + + /* + * everything ok, do it + */ + + atr_add_raw(thing, switchkey, unparse_boolexp_quiet(player, okey)); + safe_str("1", buff, bufc); + } + free_boolexp(okey); + } Index: functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/functions.c,v retrieving revision 1.5.2.9 retrieving revision 1.5.2.10 diff -C2 -d -r1.5.2.9 -r1.5.2.10 *** functions.c 21 Jul 2002 20:43:48 -0000 1.5.2.9 --- functions.c 30 Sep 2003 01:38:35 -0000 1.5.2.10 *************** *** 76,79 **** --- 76,82 ---- XFUNCTION(fun_btlostohex) XFUNCTION(fun_btlostomech) + XFUNCTION(fun_btaddparts) + XFUNCTION(fun_btloadmap) + XFUNCTION(fun_btloadmech) XFUNCTION(fun_cwho); XFUNCTION(fun_clist); *************** *** 90,93 **** --- 93,97 ---- XFUNCTION(fun_create); XFUNCTION(fun_set); + XFUNCTION(fun_setlock); #endif XFUNCTION(fun_last); *************** *** 5122,5125 **** --- 5126,5132 ---- {"BTLOSTOHEX", fun_btlostohex, 3, 0, CA_WIZARD}, {"BTLOSTOMECH", fun_btlostomech, 2, 0, CA_WIZARD}, + {"BTADDPARTS", fun_btaddparts, 3, 0, CA_WIZARD}, + {"BTLOADMAP", fun_btloadmap, 2, FN_VARARGS, CA_WIZARD}, + {"BTLOADMECH", fun_btloadmech, 2, 0, CA_WIZARD}, #endif {"CAPSTR", fun_capstr, -1, 0, CA_PUBLIC}, *************** *** 5295,5298 **** --- 5302,5306 ---- {"SETDIFF", fun_setdiff, 0, FN_VARARGS, CA_PUBLIC}, {"SETINTER", fun_setinter, 0, FN_VARARGS, CA_PUBLIC}, + {"SETLOCK", fun_setlock, 3, 0, CA_WIZARD}, {"SETQ", fun_setq, 2, 0, CA_PUBLIC}, {"SETR", fun_setr, 2, 0, CA_PUBLIC}, Index: wiz.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/wiz.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** wiz.c 3 Jan 2002 00:59:35 -0000 1.1.1.1 --- wiz.c 30 Sep 2003 01:38:35 -0000 1.1.1.1.2.1 *************** *** 62,66 **** } else { init_match(player, arg1, NOTYPE); ! match_everything(MAT_NO_EXITS); victim = noisy_match_result(); --- 62,66 ---- } else { init_match(player, arg1, NOTYPE); ! match_everything(0); victim = noisy_match_result(); --- .depend DELETED --- --- Makefile.in DELETED --- --- configure DELETED --- --- configure.in DELETED --- |
From: Thomas W. <two...@us...> - 2003-09-30 01:38:39
|
Update of /cvsroot/btech/btechmux/src/hcode In directory sc8-pr-cvs1:/tmp/cvs-serv2119/src/hcode Modified Files: Tag: btmux_1_4-branch glue.scode.c Removed Files: Tag: btmux_1_4-branch .depend Makefile Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. Index: glue.scode.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.scode.c,v retrieving revision 1.2.2.14 retrieving revision 1.2.2.15 diff -C2 -d -r1.2.2.14 -r1.2.2.15 *** glue.scode.c 30 Jul 2002 20:31:56 -0000 1.2.2.14 --- glue.scode.c 30 Sep 2003 01:38:35 -0000 1.2.2.15 *************** *** 19,22 **** --- 19,23 ---- #include "mech.h" + #include "mech.events.h" #include "glue.h" #include "extern.h" *************** *** 41,44 **** --- 42,47 ---- #include "p.mech.move.h" #include "p.mech.los.h" + #include "p.event.h" + #include "p.mech.restrict.h" extern SpecialObjectStruct SpecialObjects[]; *************** *** 1282,1285 **** --- 1285,1372 ---- safe_tprintf_str(buff, bufc, "0"); } + + FUNCTION(fun_btaddparts) + { + /* fargs[0] = mech/map + fargs[1] = partname + fargs[2] = quantity + */ + int loc; + int index = -1, id = 0, brand = 0, count; + + FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); + loc = match_thing(player, fargs[0]); + FUNCHECK(!Good_obj(loc), "#-1 INVALID TARGET"); + FUNCHECK(strlen(fargs[1]) >= MBUF_SIZE, "#-1 PARTNAME TOO LONG"); + FUNCHECK(!fargs[1], "#-1 NEED PARTNAME"); + count = atoi(fargs[2]); + FUNCHECK(!count, "1"); + FUNCHECK(!find_matching_short_part(fargs[1], &index, &id, &brand) && + !find_matching_vlong_part(fargs[1], &index, &id, &brand) && + !find_matching_long_part(fargs[1], &index, &id, &brand), "0"); + found: + econ_change_items(loc, id, brand, count); + SendEcon(tprintf("#%d added %d %s to #%d", player, count, + get_parts_vlong_name(id, brand), loc)); + safe_tprintf_str(buff, bufc, "1"); + } + + extern int xlate(char *); + + FUNCTION(fun_btloadmap) + { + /* fargs[0] = mapobject + fargs[1] = mapname + fargs[2] = clear or not to clear + */ + int mapdbref; + MAP * map; + + FUNCHECK(nfargs < 2 || nfargs > 3, + "#-1 BTLOADMAP TAKES 2 OR 3 ARGUMENTS"); + FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); + mapdbref = match_thing(player, fargs[0]); + FUNCHECK(!Good_obj(mapdbref), "#-1 INVALID TARGET"); + map = getMap(mapdbref); + FUNCHECK(!map, "#-1 INVALID TARGET"); + switch (map_load(map, fargs[1])) { + case -1: + safe_str("#-1 MAP NOT FOUND", buff, bufc); + return; + case -2: + safe_str("#-1 INVALID MAP", buff, bufc); + return; + case 0: + break; + default: + safe_str("#-1 UNKNOWN ERROR", buff, bufc); + return; + } + if (nfargs > 2 && xlate(fargs[2])) + map_clearmechs(player, (void *)map, ""); + safe_str("1", buff, bufc); + } + + FUNCTION(fun_btloadmech) + { + /* fargs[0] = mechobject + fargs[1] = mechref + */ + int mechdbref; + MECH *mech; + + FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); + mechdbref = match_thing(player, fargs[0]); + FUNCHECK(!Good_obj(mechdbref), "#-1 INVALID TARGET"); + mech = getMech(mechdbref); + FUNCHECK(!mech, "#-1 INVALID TARGET"); + if (mech_loadnew(player, mech, fargs[1]) == 1) { + event_remove_data((void *)mech); + clear_mech_from_LOS(mech); + safe_str("1", buff, bufc); + } else { + safe_str("#-1 UNABLE TO LOAD TEMPLATE", buff, bufc); + } + } #endif --- .depend DELETED --- --- Makefile DELETED --- |
From: Thomas W. <two...@us...> - 2003-09-30 01:38:39
|
Update of /cvsroot/btech/btechmux In directory sc8-pr-cvs1:/tmp/cvs-serv2119 Added Files: Tag: btmux_1_4-branch Makefile.in README.BitKeeper configure configure.in Removed Files: Tag: btmux_1_4-branch Makefile .depend Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. --- NEW FILE: Makefile.in --- #!/usr/bin/make -f CC = @CC@ MAKEDEPEND = gcc -MM CFLAGS = -g -Wall -O2 -Wno-unused -fno-strict-aliasing INCLUDES = -Iinclude -Isrc -Isrc/hcode/include -Isrc/hcode/btech LIBS = @LIBS@ VERSION_FLAGS = -DMUX_BUILD_DATE="\"`date`\"" \ -DMUX_BUILD_NUM="\"`sh src/buildnum.sh`\"" BUILDFLAGS = -DMYFIFO -DMEMORY_BASED -DBT_ENABLED -DHUDINFO_SUPPORT ALLFLAGS = $(CFLAGS) $(INCLUDES) $(BUILDFLAGS) PROTOMAKER = bin/protomaker.sh MISC_OBJECTS = misc/myfifo.o EVENT_OBJECTS = event/event.o TREE_OBJECTS = tree/mux_tree.o \ tree/tree.o \ MUX_OBJECTS = src/alloc.o \ src/boolexp.o \ src/bsd.o \ src/commac.o \ src/command.o \ src/compat.o \ src/comsys.o \ src/conf.o \ src/cque.o \ src/create.o \ src/db.o \ src/db_rw.o \ src/eval.o \ src/file_c.o \ src/flags.o \ src/funceval.o \ src/functions.o \ src/game.o \ src/help.o \ src/htab.o \ src/log.o \ src/look.o \ src/macro.o \ src/mail.o \ src/match.o \ src/mguests.o \ src/move.o \ src/netcommon.o \ src/object.o \ src/player.o \ src/player_c.o \ src/powers.o \ src/predicates.o \ src/python.o \ src/regexp.o \ src/rob.o \ src/set.o \ src/speech.o \ src/strhandler.o \ src/stringutil.o \ src/timer.o \ src/unparse.o \ src/vattr.o \ src/walkdb.o \ src/wild.o \ src/wiz.o \ HCODE_OBJECTS = src/hcode/coolmenu.o \ src/hcode/debug.o \ src/hcode/events.o \ src/hcode/glue.hcode.o \ src/hcode/glue.o \ src/hcode/glue.scode.o \ src/hcode/luck.o \ src/hcode/mech.lostracer.o \ src/hcode/mechfile.o \ src/hcode/spath.o \ BTECH_OBJECTS = src/hcode/btech/aero.bomb.o \ src/hcode/btech/aero.move.o \ src/hcode/btech/ai.o \ src/hcode/btech/artillery.o \ src/hcode/btech/autogun.o \ src/hcode/btech/autopilot.o \ src/hcode/btech/autopilot_command.o \ src/hcode/btech/autopilot_commands.o \ src/hcode/btech/bsuit.o \ src/hcode/btech/btech.o \ src/hcode/btech/btechstats.o \ src/hcode/btech/btspath.o \ src/hcode/btech/crit.o \ src/hcode/btech/ds.bay.o \ src/hcode/btech/ds.turret.o \ src/hcode/btech/econ.o \ src/hcode/btech/econ_cmds.o \ src/hcode/btech/eject.o \ src/hcode/btech/failures.o \ src/hcode/btech/hudinfo.o \ src/hcode/btech/map.bits.o \ src/hcode/btech/map.coding.o \ src/hcode/btech/map.conditions.o \ src/hcode/btech/map.dynamic.o \ src/hcode/btech/map.los.o \ src/hcode/btech/map.o \ src/hcode/btech/map.obj.o \ src/hcode/btech/mech.advanced.o \ src/hcode/btech/mech.ammodump.o \ src/hcode/btech/mech.avail.o \ src/hcode/btech/mech.bth.o \ src/hcode/btech/mech.build.o \ src/hcode/btech/mech.c3.misc.o \ src/hcode/btech/mech.c3.o \ src/hcode/btech/mech.c3i.o \ src/hcode/btech/mech.combat.misc.o \ src/hcode/btech/mech.combat.missile.o \ src/hcode/btech/mech.combat.o \ src/hcode/btech/mech.consistency.o \ src/hcode/btech/mech.contacts.o \ src/hcode/btech/mech.custom.o \ src/hcode/btech/mech.damage.o \ src/hcode/btech/mech.ecm.o \ src/hcode/btech/mech.enhanced.criticals.o \ src/hcode/btech/mech.events.o \ src/hcode/btech/mech.fire.o \ src/hcode/btech/mech.hitloc.o \ src/hcode/btech/mech.ice.o \ src/hcode/btech/mech.lite.o \ src/hcode/btech/mech.los.o \ src/hcode/btech/mech.maps.o \ src/hcode/btech/mech.mechref_ident.o \ src/hcode/btech/mech.move.o \ src/hcode/btech/mech.notify.o \ src/hcode/btech/mech.ood.o \ src/hcode/btech/mech.partnames.o \ src/hcode/btech/mech.physical.o \ src/hcode/btech/mech.pickup.o \ src/hcode/btech/mech.restrict.o \ src/hcode/btech/mech.scan.o \ src/hcode/btech/mech.sensor.functions.o \ src/hcode/btech/mech.sensor.o \ src/hcode/btech/mech.spot.o \ src/hcode/btech/mech.startup.o \ src/hcode/btech/mech.stat.o \ src/hcode/btech/mech.status.o \ src/hcode/btech/mech.tag.o \ src/hcode/btech/mech.tech.commands.o \ src/hcode/btech/mech.tech.damages.o \ src/hcode/btech/mech.tech.do.o \ src/hcode/btech/mech.tech.events.o \ src/hcode/btech/mech.tech.o \ src/hcode/btech/mech.tech.repairs.o \ src/hcode/btech/mech.tech.saverepair.o \ src/hcode/btech/mech.tic.o \ src/hcode/btech/mech.update.o \ src/hcode/btech/mech.utils.o \ src/hcode/btech/mechrep.o \ src/hcode/btech/mine.o \ src/hcode/btech/pcombat.o \ src/hcode/btech/scen.o \ src/hcode/btech/template.o \ ALLOBJS = $(MISC_OBJECTS) $(EVENT_OBJECTS) $(TREE_OBJECTS) \ $(MUX_OBJECTS) $(HCODE_OBJECTS) $(BTECH_OBJECTS) ALLSRCS = $(ALLOBJS:.o=.c) TARGETS = src/netmux src/mkindx src/unsplit src/slave all: $(TARGETS) # Install copies the 'game' directory to game.run, after trying to get all # files from bk. If the bk command fails, we don't really care. install: $(TARGETS) mv -f $(TARGETS) game/bin/ netmux src/netmux: $(ALLOBJS) src/version.c src/buildnum.sh $(CC) $(ALLFLAGS) $(VERSION_FLAGS) -c src/version.c -o src/version.o $(CC) $(ALLFLAGS) -o src/netmux $(ALLOBJS) src/version.o $(LIBS) clean: rm -f $(ALLOBJS) src/version.o src/netmux src/mkindx src/unsplit slave src/slave: src/slave.c $(CC) $(ALLFLAGS) -o src/slave src/slave.c mkindx src/mkindx: src/mkindx.o $(CC) $(ALLFLAGS) -o src/mkindx src/mkindx.o unsplit src/unsplit: src/unsplit.o $(CC) $(ALLFLAGS) -o src/unsplit src/unsplit.o dbconvert src/dbconvert: echo "dbconvert is no longer supported." && exit 1; $(ALLOBJS): %.o: %.c $(CC) $(ALLFLAGS) -c $< -o $@ protos: $(PROTOMAKER) $(PROTOMAKER) "$(INCLUDES)" $(ALLSRCS) .depend: $(MAKEDEPEND) $(ALLFLAGS) $(ALLSRCS) > .depend depend dep: .depend .PHONY: clean protos include .depend --- NEW FILE: README.BitKeeper --- This CVS repository is currently in 'slave' mode to the BitKeeper repository hosted at BK/Bits (http://btechmux.bkbits.net) while I evaluate BitKeeper's branching. I will attempt to keep them in sync at least while I'm making up my mind what to do with this project; the 'official' tree may switch to BitKeeper, or it may stay CVS -- or it may switch to an externally hosted Subversion or Aegis or Perforce system (or hosted by SF, if they ever offer anything but CVS.) - Focus --- NEW FILE: configure --- #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache [...2779 lines suppressed...] # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <<EOF EOF cat >> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 --- NEW FILE: configure.in --- dnl Process this file with autoconf to produce a configure script. AC_INIT(src/mudconf.h) AC_CONFIG_HEADER(src/autoconf.h) AC_PROG_CC AC_PROG_CPP AC_ISC_POSIX AC_MINIX AC_HEADER_STDC AC_CHECK_HEADERS(memory.h unistd.h errno.h malloc.h ieeefp.h sys/select.h sys/rusage.h sys/ucontext.h) AC_TIME_WITH_SYS_TIME AC_FUNC_VFORK AC_FUNC_VPRINTF AC_HAVE_FUNCS(setrlimit getrusage timelocal mktime srandom) AC_HAVE_FUNCS(getpagesize getdtablesize socket gethostbyaddr) AC_HAVE_FUNCS(gettimeofday) AC_REPLACE_FUNCS(strdup) AC_TYPE_SIGNAL AC_FUNC_WAIT3 AC_STRUCT_TM AC_STRUCT_TIMEZONE AC_TYPE_PID_T AC_MSG_CHECKING(for union wait) AC_TRY_COMPILE([#include <sys/wait.h>],[union wait stat;], AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_DECL_SYS_SIGLIST AC_C_CONST AC_C_CHAR_UNSIGNED AC_C_INLINE AC_MSG_CHECKING(for linger) AC_TRY_COMPILE([#include <sys/socket.h>],[struct linger ling; ling.l_onoff = 1;], AC_DEFINE(HAVE_LINGER) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_CHECK_LIB(crypt, crypt) case "$DEFS" in *HAVE_SOCKET*) ;; *) AC_CHECK_LIB(socket, main) ;; esac case "$DEFS" in *HAVE_GETHOSTBYADDR*) ;; *) AC_CHECK_LIB(inet, main) ;; esac AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(bsd, main) AC_CHECK_LIB(iberty, main) AC_CHECK_LIB(m, main) AC_OUTPUT(Makefile) --- Makefile DELETED --- --- .depend DELETED --- |
From: Thomas W. <two...@us...> - 2003-09-30 01:38:39
|
Update of /cvsroot/btech/btechmux/tree In directory sc8-pr-cvs1:/tmp/cvs-serv2119/tree Removed Files: Tag: btmux_1_4-branch .depend Makefile Log Message: Merge with the Bitkeeper repository at http://btechmux.bkbits.net/btechmux-stable (the 'stable' branch.) This adds a cleaner build system (no recursive make, for one) and a host of small features as seen on 3030MUX. --- .depend DELETED --- --- Makefile DELETED --- |
From: Thomas W. <two...@us...> - 2003-09-30 01:02:05
|
Update of /cvsroot/btech/btechmux/src/hcode In directory sc8-pr-cvs1:/tmp/cvs-serv28449/src/hcode Modified Files: glue.c glue.scode.c Removed Files: .depend Makefile Log Message: Massive sync with the 'development' repository at http://btechmux.bkbits.net/btechmux. Among other things, this redoes the build system to be less... convoluted, and adds Cord's MechWarrior 3rd Edition skill system as well as a fairly large set of bugfixes and minor new features. Index: glue.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** glue.c 3 Apr 2002 11:30:18 -0000 1.6 --- glue.c 30 Sep 2003 01:01:31 -0000 1.7 *************** *** 642,646 **** notify(player, "Valid XTYPEs include: MECH, MECHREP, MAP, DEBUG, " ! "CHARGEN, AUTOPILOT, TURRET, CUSTOM, SCEN, SSIDE, SSOBJ, " "SSINS, SSEXT"); notify(player, "Resetting hardcode flag."); --- 642,646 ---- notify(player, "Valid XTYPEs include: MECH, MECHREP, MAP, DEBUG, " ! "AUTOPILOT, TURRET, CUSTOM, SCEN, SSIDE, SSOBJ, " "SSINS, SSEXT"); notify(player, "Resetting hardcode flag."); *************** *** 663,667 **** notify(player, "Valid XTYPEs include: MECH, MECHREP, MAP, DEBUG, " ! "CHARGEN, AUTOPILOT, TURRET, CUSTOM, SCEN, SSIDE, SSOBJ, " "SSINS, SSEXT"); notify(player, "Resetting HARDCODE flag."); --- 663,667 ---- notify(player, "Valid XTYPEs include: MECH, MECHREP, MAP, DEBUG, " ! "AUTOPILOT, TURRET, CUSTOM, SCEN, SSIDE, SSOBJ, " "SSINS, SSEXT"); notify(player, "Resetting HARDCODE flag."); Index: glue.scode.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/hcode/glue.scode.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** glue.scode.c 31 Jul 2002 14:53:04 -0000 1.5 --- glue.scode.c 30 Sep 2003 01:01:31 -0000 1.6 *************** *** 19,22 **** --- 19,23 ---- #include "mech.h" + #include "mech.events.h" #include "glue.h" #include "extern.h" *************** *** 41,44 **** --- 42,47 ---- #include "p.mech.move.h" #include "p.mech.los.h" + #include "p.event.h" + #include "p.mech.restrict.h" extern SpecialObjectStruct SpecialObjects[]; *************** *** 1102,1106 **** } ! FUNCTION(fun_btthreshhold) { /* --- 1105,1109 ---- } ! FUNCTION(fun_btBaseXPMod) { /* *************** *** 1110,1114 **** FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); ! xpth = btthreshhold_func(fargs[0]); safe_tprintf_str(buff, bufc, xpth < 0 ? "#%d ERROR" : "%d", xpth); } --- 1113,1117 ---- FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); ! xpth = btBaseXPMod_func(fargs[0]); safe_tprintf_str(buff, bufc, xpth < 0 ? "#%d ERROR" : "%d", xpth); } *************** *** 1331,1334 **** --- 1334,1421 ---- safe_tprintf_str(buff, bufc, "0"); } + + FUNCTION(fun_btaddparts) + { + /* fargs[0] = mech/map + fargs[1] = partname + fargs[2] = quantity + */ + int loc; + int index = -1, id = 0, brand = 0, count; + + FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); + loc = match_thing(player, fargs[0]); + FUNCHECK(!Good_obj(loc), "#-1 INVALID TARGET"); + FUNCHECK(strlen(fargs[1]) >= MBUF_SIZE, "#-1 PARTNAME TOO LONG"); + FUNCHECK(!fargs[1], "#-1 NEED PARTNAME"); + count = atoi(fargs[2]); + FUNCHECK(!count, "1"); + FUNCHECK(!find_matching_short_part(fargs[1], &index, &id, &brand) && + !find_matching_vlong_part(fargs[1], &index, &id, &brand) && + !find_matching_long_part(fargs[1], &index, &id, &brand), "0"); + found: + econ_change_items(loc, id, brand, count); + SendEcon(tprintf("#%d added %d %s to #%d", player, count, + get_parts_vlong_name(id, brand), loc)); + safe_tprintf_str(buff, bufc, "1"); + } + + extern int xlate(char *); + + FUNCTION(fun_btloadmap) + { + /* fargs[0] = mapobject + fargs[1] = mapname + fargs[2] = clear or not to clear + */ + int mapdbref; + MAP * map; + + FUNCHECK(nfargs < 2 || nfargs > 3, + "#-1 BTLOADMAP TAKES 2 OR 3 ARGUMENTS"); + FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); + mapdbref = match_thing(player, fargs[0]); + FUNCHECK(!Good_obj(mapdbref), "#-1 INVALID TARGET"); + map = getMap(mapdbref); + FUNCHECK(!map, "#-1 INVALID TARGET"); + switch (map_load(map, fargs[1])) { + case -1: + safe_str("#-1 MAP NOT FOUND", buff, bufc); + return; + case -2: + safe_str("#-1 INVALID MAP", buff, bufc); + return; + case 0: + break; + default: + safe_str("#-1 UNKNOWN ERROR", buff, bufc); + return; + } + if (nfargs > 2 && xlate(fargs[2])) + map_clearmechs(player, (void *)map, ""); + safe_str("1", buff, bufc); + } + + FUNCTION(fun_btloadmech) + { + /* fargs[0] = mechobject + fargs[1] = mechref + */ + int mechdbref; + MECH *mech; + + FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); + mechdbref = match_thing(player, fargs[0]); + FUNCHECK(!Good_obj(mechdbref), "#-1 INVALID TARGET"); + mech = getMech(mechdbref); + FUNCHECK(!mech, "#-1 INVALID TARGET"); + if (mech_loadnew(player, mech, fargs[1]) == 1) { + event_remove_data((void *)mech); + clear_mech_from_LOS(mech); + safe_str("1", buff, bufc); + } else { + safe_str("#-1 UNABLE TO LOAD TEMPLATE", buff, bufc); + } + } #endif --- .depend DELETED --- --- Makefile DELETED --- |
From: Thomas W. <two...@us...> - 2003-09-30 01:02:05
|
Update of /cvsroot/btech/btechmux/src In directory sc8-pr-cvs1:/tmp/cvs-serv28449/src Modified Files: funceval.c functions.c wiz.c Removed Files: .depend Makefile.in configure configure.in mech.ecm.h Log Message: Massive sync with the 'development' repository at http://btechmux.bkbits.net/btechmux. Among other things, this redoes the build system to be less... convoluted, and adds Cord's MechWarrior 3rd Edition skill system as well as a fairly large set of bugfixes and minor new features. Index: funceval.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/funceval.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** funceval.c 31 Jul 2002 14:53:04 -0000 1.5 --- funceval.c 30 Sep 2003 01:01:31 -0000 1.6 *************** *** 3334,3335 **** --- 3334,3430 ---- } } + + /* + * --------------------------------------------------------------------------- + * fun_setlock: Set lock from a function (like @lock) + */ + + extern NAMETAB lock_sw; + + FUNCTION(fun_setlock) + { + int switchkey = 0; + dbref thing, aowner; + int atr, aflags; + ATTR *ap; + struct boolexp *okey; + + if (*fargs[0]) { + switchkey = search_nametab(player, &lock_sw, fargs[0]); + if (switchkey < 0) { + safe_str("#-1 SWITCH ERROR", buff, bufc); + return; + } + } + + if (parse_attrib(player, fargs[1], &thing, &atr)) { + if (atr != NOTHING) { + if (!atr_get_info(thing, atr, &aowner, &aflags)) { + safe_str("#-1 ATTR NOT FOUND", buff, bufc); + return; + } + ap = atr_num(atr); + + /* + * You may lock an attribute iff: you could write the + * attribute if it were stored on yourself --and-- you own + * the attribute or are a wizard as long as you are not #1 + * and are trying to do something to #1. + */ + + if (ap && (God(player) || (!God(thing) && + (Set_attr(player, player, ap, 0) && (Wizard(player) + || aowner == Owner(player)))))) { + if (*fargs[2]) + aflags |= AF_LOCK; + else + aflags &= ~AF_LOCK; + atr_set_flags(thing, atr, aflags); + safe_str("1", buff, bufc); + } else { + safe_str("#-1 PERMISSION DENIED", buff, bufc); + } + return; + } + } + init_match(player, fargs[1], NOTYPE); + match_everything(MAT_EXIT_PARENTS); + thing = match_result(); + + switch (thing) { + case NOTHING: + safe_str("#-1 NOT FOUND", buff, bufc); + return; + case AMBIGUOUS: + safe_str("#-1 AMBIGUOUS MATCH", buff, bufc); + return; + default: + if (!controls(player, thing)) { + safe_str("#-1 PERMISSION DENIED", buff, bufc); + return; + } + } + + if (!switchkey) + switchkey = A_LOCK; + + if (!*fargs[2]) { + atr_clr(thing, switchkey); + safe_str("1", buff, bufc); + return; + } + + okey = parse_boolexp(player, fargs[2], 0); + if (okey == TRUE_BOOLEXP) { + safe_str("#-1 KEY ERROR", buff, bufc); + } else { + + /* + * everything ok, do it + */ + + atr_add_raw(thing, switchkey, unparse_boolexp_quiet(player, okey)); + safe_str("1", buff, bufc); + } + free_boolexp(okey); + } Index: functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/functions.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** functions.c 31 Jul 2002 14:53:04 -0000 1.10 --- functions.c 30 Sep 2003 01:01:31 -0000 1.11 *************** *** 65,69 **** XFUNCTION(fun_btsetarmorstatus); XFUNCTION(fun_btweaponstatus); ! XFUNCTION(fun_btthreshhold); XFUNCTION(fun_btdamagemech); XFUNCTION(fun_btarmorref); --- 65,69 ---- XFUNCTION(fun_btsetarmorstatus); XFUNCTION(fun_btweaponstatus); ! XFUNCTION(fun_btBaseXPMod); XFUNCTION(fun_btdamagemech); XFUNCTION(fun_btarmorref); *************** *** 79,82 **** --- 79,85 ---- XFUNCTION(fun_btlostohex) XFUNCTION(fun_btlostomech) + XFUNCTION(fun_btaddparts) + XFUNCTION(fun_btloadmap) + XFUNCTION(fun_btloadmech) XFUNCTION(fun_cwho); XFUNCTION(fun_clist); *************** *** 93,96 **** --- 96,100 ---- XFUNCTION(fun_create); XFUNCTION(fun_set); + XFUNCTION(fun_setlock); #endif XFUNCTION(fun_last); *************** *** 5097,5101 **** #ifdef BT_ENABLED {"BTDESIGNEX", fun_btdesignex, 1, 0, CA_PUBLIC}, ! {"BTTHRESHHOLD",fun_btthreshhold, 1, 0, CA_WIZARD}, {"BTGETCHARVALUE", fun_btgetcharvalue, 3, 0, CA_WIZARD}, {"BTLAG", fun_lag, 0, 0, CA_WIZARD}, --- 5101,5105 ---- #ifdef BT_ENABLED {"BTDESIGNEX", fun_btdesignex, 1, 0, CA_PUBLIC}, ! {"BTBASEXPMOD",fun_btBaseXPMod, 1, 0, CA_WIZARD}, {"BTGETCHARVALUE", fun_btgetcharvalue, 3, 0, CA_WIZARD}, {"BTLAG", fun_lag, 0, 0, CA_WIZARD}, *************** *** 5131,5134 **** --- 5135,5141 ---- {"BTLOSTOHEX", fun_btlostohex, 3, 0, CA_WIZARD}, {"BTLOSTOMECH", fun_btlostomech, 2, 0, CA_WIZARD}, + {"BTADDPARTS", fun_btaddparts, 3, 0, CA_WIZARD}, + {"BTLOADMAP", fun_btloadmap, 2, FN_VARARGS, CA_WIZARD}, + {"BTLOADMECH", fun_btloadmech, 2, 0, CA_WIZARD}, #endif {"CAPSTR", fun_capstr, -1, 0, CA_PUBLIC}, *************** *** 5304,5307 **** --- 5311,5315 ---- {"SETDIFF", fun_setdiff, 0, FN_VARARGS, CA_PUBLIC}, {"SETINTER", fun_setinter, 0, FN_VARARGS, CA_PUBLIC}, + {"SETLOCK", fun_setlock, 3, 0, CA_WIZARD}, {"SETQ", fun_setq, 2, 0, CA_PUBLIC}, {"SETR", fun_setr, 2, 0, CA_PUBLIC}, Index: wiz.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/wiz.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** wiz.c 3 Jan 2002 00:59:35 -0000 1.1.1.1 --- wiz.c 30 Sep 2003 01:01:31 -0000 1.2 *************** *** 62,66 **** } else { init_match(player, arg1, NOTYPE); ! match_everything(MAT_NO_EXITS); victim = noisy_match_result(); --- 62,66 ---- } else { init_match(player, arg1, NOTYPE); ! match_everything(0); victim = noisy_match_result(); --- .depend DELETED --- --- Makefile.in DELETED --- --- configure DELETED --- --- configure.in DELETED --- --- mech.ecm.h DELETED --- |
From: Thomas W. <two...@us...> - 2003-09-30 01:02:04
|
Update of /cvsroot/btech/btechmux/game In directory sc8-pr-cvs1:/tmp/cvs-serv28449/game Modified Files: MUXample.conf Log Message: Massive sync with the 'development' repository at http://btechmux.bkbits.net/btechmux. Among other things, this redoes the build system to be less... convoluted, and adds Cord's MechWarrior 3rd Edition skill system as well as a fairly large set of bugfixes and minor new features. Index: MUXample.conf =================================================================== RCS file: /cvsroot/btech/btechmux/game/MUXample.conf,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** MUXample.conf 3 Jan 2002 01:01:42 -0000 1.1.1.1 --- MUXample.conf 30 Sep 2003 01:01:30 -0000 1.2 *************** *** 101,102 **** --- 101,104 ---- # Enable btech extensions have_specials 1 + btech_stacking 1 + |
From: Thomas W. <two...@us...> - 2003-09-30 01:02:04
|
Update of /cvsroot/btech/btechmux/game/mechs/Vehicles In directory sc8-pr-cvs1:/tmp/cvs-serv28449/game/mechs/Vehicles Modified Files: Tokugawa Log Message: Massive sync with the 'development' repository at http://btechmux.bkbits.net/btechmux. Among other things, this redoes the build system to be less... convoluted, and adds Cord's MechWarrior 3rd Edition skill system as well as a fairly large set of bugfixes and minor new features. Index: Tokugawa =================================================================== RCS file: /cvsroot/btech/btechmux/game/mechs/Vehicles/Tokugawa,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Tokugawa 18 Jul 2002 19:20:02 -0000 1.2 --- Tokugawa 30 Sep 2003 01:01:30 -0000 1.3 *************** *** 2,6 **** Reference { Tokugawa } Type { Vehicle } ! Move_Type { Track } Tons { 60 } Comment { Saved by: Charlemagne(#4624) at Wed Feb 16 07:59:03 2000 } --- 2,6 ---- Reference { Tokugawa } Type { Vehicle } ! Move_Type { Wheel } Tons { 60 } Comment { Saved by: Charlemagne(#4624) at Wed Feb 16 07:59:03 2000 } *************** *** 8,26 **** Max_Speed { 64.50 } Left_Side ! Armor { 26 } Internals { 6 } Right_Side ! Armor { 26 } Internals { 6 } Front_Side ! Armor { 24 } Internals { 6 } CRIT_1 { IS.MediumPulseLaser - - 3 } CRIT_2 { IS.MediumPulseLaser - - 3 } Aft_Side ! Armor { 20 } Internals { 6 } Turret ! Armor { 20 } Internals { 6 } CRIT_1 { IS.LB10-XAC - - 3 } --- 8,26 ---- Max_Speed { 64.50 } Left_Side ! Armor { 33 } Internals { 6 } Right_Side ! Armor { 33 } Internals { 6 } Front_Side ! Armor { 40 } Internals { 6 } CRIT_1 { IS.MediumPulseLaser - - 3 } CRIT_2 { IS.MediumPulseLaser - - 3 } Aft_Side ! Armor { 26 } Internals { 6 } Turret ! Armor { 36 } Internals { 6 } CRIT_1 { IS.LB10-XAC - - 3 } |