Index: circle/ChangeLog diff -u circle/ChangeLog:1.158 circle/ChangeLog:1.181 --- circle/ChangeLog:1.158 Sun Mar 18 18:59:11 2001 +++ circle/ChangeLog Tue Aug 14 21:50:43 2001 @@ -1,6 +1,8 @@ Release history: +Version 3.00 beta pl19 release: August 14, 2001 +Version 3.00 beta pl18 release: March 18, 2001 Version 3.00 beta pl17 release: January 23, 2000 Version 3.00 beta pl16 release: August 30, 1999 Version 3.00 beta pl15 release: March 16, 1999 @@ -8,7 +10,6 @@ Version 3.00 beta pl13a release: June 4, 1998 Version 3.00 beta pl13 release: June 1, 1998 Version 3.00 beta pl12 release: October 29, 1997 -Version 3.00 beta pl12 release: October 29, 1997 Version 3.00 beta pl11 release: April 14, 1996 Version 3.00 beta pl10 release: March 11, 1996 Version 3.00 beta pl9 release: February 6, 1996 @@ -3060,6 +3061,13 @@ -- gg - lib/world/obj/0.obj: An extra ~ escaped the removal of object #99. +10/27/2000 + +-- ae - act.informative.c: Fixed do_time() with the fix submitted by Nate + Winters that corrected the output on the 11th, + 12th, and 13th of a month (it used to output '11st', '12nd', and + '13rd'. Not so good really. + 11/3/2000 -- gg - shop.c: Del noted the @@ -3072,6 +3080,26 @@ -- gg - act.other.c: do_quit: !GET_INVIS_LEV is redundant. +9/18/2000 + +-- ae - comm.c: Added in $u and $U act() codes to perform_act(). These allow + the user to uppercase the first letter of the previous ($u) or next + ($U) word. For example, from the social for 'snarl': + $n snarls angrily at $N. $e$u seems incapable of controlling $mself. + $n snarls viciously at you. $U$s self-control seems to have gone bananas. + In the old style, these would have come out as: + George snarls angrily at Daniel. he seems incapable of controlling himself. + George snarls angrily at you. his self-control seems to have gone bananas. + In the new, we get: + George snarls angrily at Daniel. He seems incapable of controlling himself. + George snarls angrily at you. His self-control seems to have gone bananas. + This comes a little bit closer to proper sentence output and looks + much nicer to boot. + +12/07/2000 + +-- ae - Removed some 'offensive' language from act.item.c and magic.c. + 1/17/2001 -- gg - db.c: load_zones(): More accurate counting based in part @@ -3109,6 +3137,19 @@ -- gg - generic_find(): Fix for '2.bread' with one on the ground and one in your inventory. +-- ae - spec_procs.c: Added a CAN_SEE() check into npc_steal() to stop mobs + with the thief special from stealing from people that they can't even + see. Reported by Vladimir Prelovac + +1/26/2001 + +-- ae - act.other.c: Shifted the checking for duping into extract_char(). I + was toying and discovered that renting out skips all of the dup checks + that we had in and so does dieing. Whoops. Also, we were setting the + state of the descriptor to CON_DISCONNECT when that state is used + everywhere else for players that have the state of CON_PLAYING, so I + changed that to CON_CLOSE. (also note 'handler.c') + 2/18/2001 -- gg - comm.c: perform_socket_read(): Handle ECONNRESET by booting @@ -3135,7 +3176,7 @@ -- gg - db.c: load_zones(): Skip first 3 lines to avoid mistaking zone name for a command. --- gg - boards.c: init_boards(): -1 => NOWHERE +-- gg - boards.c: init_boards(): -1 => NOTHING -- gg - comm.c: game_loop(): Use RL_SEC more. heartbeat(): More PULSE_* constants. @@ -3158,3 +3199,333 @@ -- gg - handler.[ch], structs.h, comm.c, act.offensive.c, fight.c: New delayed extraction sequence to avoid dangling pointer crashes. + +-- gg - Released patchlevel 18. + +******** Patchlevel 19 *************************************************** + +3/18/2001 + +-- gg - constants.c, structs.h, Makefile.lcc, doc/README.CYGWIN: + Welcome to bpl19. + +5/1/2001 + +-- ae - Changed some '256' notes to READ_SIZE (db.c) or MAX_INPUT_LENGTH + (mail.c and handler.c). These are to keep the consistency across + functions, etc. + +-- ae - act.item.c: Removed a check for too many objects from the beginning + of do_get(). As pointed out by Vladimir Prelovac + , + 1. If there isn't anything to get you still get that message + 2. The check is already made at the appropriate time in all the other + functions that do_get() calls (in can_take_obj()). + +-- ae - constants.c: We forgot the string for the NOTDEADYET flags. Oops. + Added in 'DEAD' (with comments) for completeness. + +5/8/2001 + +-- ae - Makefile.in: Modified makefile (and added htmlheaders/footers) to + allow for cxref data creation more readily. + +5/9/2001 + +-- ae - Del submitted a 'bug' (wording problem) with a chunk in + act.movement.c that has to do with ROOM_TUNNEL. There are two + options for fixing it, so I chose the middle ground: adding a + config variable for it to config.c. This variable (tunnel_size) + indicates how large the tunnel is and defaults to 2. + +5/10/2001 + +-- ae - act.wizard.c: Added in code to remove holylight, syslog, and + nohassle when wiz+ are demoted below level 31 with do_advance(). + +-- ae - fight.c: If we don't have a fight message to send (ie, suffering, + poison, etc), then don't send the colours, and don't try to send + the message that we don't have. Reported by Andrey Fidrya + + +-- ae - db.c: This fixes a possible overflow problem in pfiles by truncating + the description if it is too long. Reported by Andrey Fidrya + + +-- ae - We had a reference to SKILL_PUNCH (#136), but in the base code, + 'punch' is an action, not a skill. Not only that, but we don't + even reference it in the lib/ anywhere. (spells.h, spell_parser.c) + +5/16/2001 + +-- ae - coding.doc: Added in a section 4 (special procedures) that was + submitted to us ages ago by Luis Pedro Passos Carvalho + . Unfortunately, due to problems with the CDP, + it languished. We just have to remember to keep the text when we + get the CDP up and running again. + +5/18/2001 + +-- gg - Global: IS_OBJ_STAT -> OBJ_FLAGGED for consistency with + MOB_FLAGGED and OBJ_FLAGGED. + +-- gg - Global: Moved a bunch of global variables to db.h. + +-- gg - act.informative.c, db.c, handler.c, interpreter.c, mobact.c, + random.c: Remove 'register' keyword, let the compiler figure + out what is best. + +-- gg - castle.c: Fix "zones are 100 rooms" assumption. + +-- gg - class.c: Fix trailing comma in prac_params[]. + From: Del + +-- gg - constants.c: Fix "the Day of the Great Gods" capitalization. + From: Carlos Myers + +-- gg - mail.c: scan_file(): Mail file is binary, open as such. + From: Marc Lank + +-- gg - interpeter.c: ACMD(do_info) and ACMD(do_offer) don't exist. + From: Del + +-- gg - magic.c: mag_points(): Rename 'hit' to 'healing' to avoid + the function named hit(). + +-- gg - shop.c: Added missing read_shop_message() declaration. + +-- gg - shop.h: Removed unused GET_OBJ_NUM() macro. + +-- gg - utils.h: Remove IF_STR(), make OBJWEAR_FLAGGED use the + GET_OBJ_WEAR information. + +-- gg - act.item.c: Removed superfluous '*next_obj'. (See the + function variable declaration section.) + +-- gg - act.wizard.c, db.c, db.h: Removed the stupid + "zone number * 100 = starting room" assumptions. + + ||| ----- ----- ----- NOTE ----- ----- ----- NOTE ----- ----- ----- ||| + + This now means you can have zones spanning anywhere, including over + each other. You can have zone #5 going from room 1354 to 2139. + That doesn't prevent zone #10 from going from 936 to 1734. We DO + NOT check for overlap. Why? Because it can be useful. No longer + are you restrained to having a zone repopulate when no one is in + the whole place, now you can do room by room (up to the limit of + 32,767 zones) for some places within a zone. In short, you no + longer have to think of a "zone" in the same way any longer. Now + it's simply a collection of loading commands for mobs/objs when a + timer fires and/or no one is in it. + + ||| ----- ----- ----- NOTE ----- ----- ----- NOTE ----- ----- ----- ||| + +-- gg - castle.c: Fixed zone*100 assumptions. + db.c: Added real_zone() for castle changes. + Changed -1's in real_mobile and real_object appropriately. + +-- gg - comm.c: close_socket(): Move NULL assignment up to fix mobile switching + problem upon disconnection. (The switched into mobile still "busy" even + though you reconnect after a drop.) + +-- gg - comm.h: USING_LARGE/USING_SMALL: Not used, removed. + +-- ae - zone file update: The zone files were all updated to suit the top + and bottom indicators put into the code. + +-- gg - db.c: load_zones(): See warning: + + ///// WARNING \\\\\ + The powers-that-be decided to change the format of the zone files + to be more reasonable with the 'bottom room' number. + + TopRoom Lifespan ResetMode => BottomRoom TopRoom Lifespan ResetMode + + Stock zones will be updated but you will need to change your own + zones by hand or your MUD will error out and not restart. + \\\\\ WARNING ///// + +-- gg - graph.c: VALID_EDGE prototype. + +-- gg - act.informative.c, constants.c, constants.h: where[] -> wear_where[] + +5/22/2001 + +-- ae - class.c: changed 'return 1', and 'return 0' to 'return TRUE' and + 'return FALSE' respectively. This brings it into the same context + as some of the other similar functions. + +5/23/2001 + +-- gg - act.item.c, act.wizard.c, handler.c, handler.h: Fix missing number + (5.Y) support for equipment due to generic_find() fix. + +6/14/2001 + +-- gg - utils.c: dice(): Use number(). + number(): Add rand() comment. + +-- gg - comm.c: init_game(): Save the MUD time on shutdown. + db.c: reset_time(): Load beginning time from lib/etc/time. + db.h: TIME_FILE: "lib/etc/time" + utils.c: mud_time_to_secs(): New. + +-- gg - db.c: interpret_espec()/parse_espec(): Finalize behavior + of Boolean options. (i.e., don't crash) + +-- gg - db.c: parse_mobile(): Clear MOB_NOTDEADYET flag on load. + +-- gg - act.informative.c: sort_commands(): YUCK! Removed the + wacky sorted command structure in favor of a new + one both smaller and more to the point. Also + killed YetAnotherBubbleSort(tm) in the process. + ACMD(do_commands): Your brain will no longer stare at + the 'if' statement and go 'Duh?'. Also fixed an + extra \r\n pair on even multiples of 7. + +-- gg - act.offensive.c: ACMD(do_order): Del + spotted an apparent left-over from Diku, 'org_room'. + Other than 'order followers cast 'teleport' leader', + I'm not sure what it was supposed to do...but it's + gone now. + +-- gg - boards.c: Board_display_msg()/Board_remove_msg(): Use + !is_number instead of !isdigit to prevent commands + like 'remove 2.ring' from affecting the messages on + a board instead. + +-- gg - objsave.c: Crash_idlesave(): Make the GET_EQ() loop match + the one in Crash_crashsave(), instead of saving the + first object in your inventory for every object you + currently had equipped. + +-- gg - db.c: parse_simple_mob(), parse_mobile(), parse_object(): + Use more macros wherever already defined for them. + +-- gg - objsave.c: Crash_delete_crashfile(), Crash_clean_file(), + Crash_listrent(): If we can't read the rent_info + information, punt early before we use garbage. + Also fixed yet another '> -1' => NOTHING issue. + +-- gg - act.wizard.c: do_stat(): 'stat file character' isn't on + the character list; use extract_char_final(). + +-- gg - act.informative.c: do_examine(): Fix not being able to + examine the inside of a 2.foo container. + +-- gg - handler.c: extract_pending_chars(): O(n^2) -> O(n) + +6/25/2001 + +-- ae - handler.c: we forgot to add GET_CHA to affect_total(), noted + by Del . + +-- ae - autorun: Peter Ajamian submitted a new autorun that is much more + configurable and robust. Information on it is contained + autorun.README and the old autorun is still available as + autorun.sh + +6/26/2001 + +-- ae - db.c: Changed the order of the available zone commands in + load_zone() to match the order of the switch statement + in reset_zone(). This makes it easier to double check + the lists against one another. Also added a comment to + each location pointing out that additions need to be made + to both locations if a new zone command is added. + +6/27/2001 + +-- ae - act.wizard.c, class.c: Todd Laycock + pointed out that with some 'careful' use of the advance + command at the wrong time, people could end up snooping + those of a higher level, and possibly introduce a nice + little 'snoop loop'. The addition of a 'snoop_check()' + routine that checks for higher/equal levels of snoopers + or snoop_bys and stops snooping if this is found was + introduced and is called from advance_level(). + +-- ae - shop.c: Rick Glover pointed out that the code + in shopping_list() would rarely (if ever) give the correct + results if someone was listing for an object and none were + found. This code chunk got rewritten and a check for any + objects found was added. + +-- ae - *.c: Reformatted code to match what we do elsewhere (ie rather + than 'struct blah * data', we generally use + 'struct blah *data'. + +-- ae - modify.c: Peter Ajamian submitted a patch + that would fix the occasional strange behaviour of the + prompt sometimes overwrites the last line of paged text in + compact mode. + +-- ae - mail.c: The postmaster will no longer allow you to send mail to + deleted characters. This is done with a check called + mail_recip_ok() which loads the character (if he exists) and + checks for the PLR_DELETED flag. Other checks can be added + as desired. Noted by Bob Castillo + +-- ae - handler.c: Andrey Fidrya pointed out that + while we check to ensure that a mob's prey is still in + the world, that memory has the potential to be reassigned + when the prey leaves the world. As such, in the + extract_char_final() routine, we scan the world for those + hunting the char being extracted and stop the hunt. + +-- ae - act.wizard.c: In the continuing series of bugs reported by + Andrey Fidrya , 'stat file ' + (when done on a player in-game) will turf his objsave + file. Anyhow, the pfile should be the same as the in-game + character regardless, so we may as well just stat the + character and avoid the rent eating problem entirely. + +7/1/2001 -- gcc 3.0 warning day. Part 1. + +-- gg - act.informative.c: Prototype sort_commands_helper. + +-- gg - comm.c: main(); db.c: parse_room(), fread_string(): + Fix bad usages of variable argument functions. + +-- gg - act.informative.c: do_users(): Fix up 'format' usage so it's more + concise and gcc can check the arguments to sprintf(). + +-- gg - ChangeLog: Fix bpl12 being released twice. + +-- gg - ban.c: do_ban(): Change to allow gcc to check arguments to + variable argument functions. + +-- gg - comm.c, utils.h: Move mud_time_to_secs() prototype. + +7/11/2001 + +-- gg - comm.c: Must not ever do function calls from an interrupt + handler without making sure every function they call are + reentrant. Think of the server as multi-threaded for it. + +7/24/2001 + +-- gg - db.c: Remove useless 'rec_count' increment. + +7/26/2001 + +-- gg - handler.c: extract_pending_chars(): Avoid free()'d memory + when a chain of people die. + +-- gg - comm.c, db.c: Save MUD time every 30 minutes and at + shutdown using save_mud_time(). + +8/2/2001 + +-- gg - comm.c: new_descriptor(): Useless memset() removed. + +8/14/2001 + +-- gg - act.informative.c: show_obj_to_char(): Die! Die! Die! + All callers updated to new SHOW_OBJ_{LONG,SHORT,ACTION} + mode parameters. + show_obj_modifiers(): Split out of show_obj_to_char() + for stuff like "(invisible)" and "humming sound." + act.comm.c, structs.h: MAX_NOTE_LENGTH moved. + +-- gg - Released patchlevel 19. Index: circle/FAQ diff -u circle/FAQ:1.13 circle/FAQ:1.14 --- circle/FAQ:1.13 Sat Dec 2 07:52:44 2000 +++ circle/FAQ Wed May 16 09:47:50 2001 @@ -159,7 +159,7 @@ 6. CircleMUD 3.0 Questions - 6.1 Are there any bugs in patch level 16? + 6.1 Are there any bugs in patch level 18? 6.2 How do I access Online Creation? @@ -277,7 +277,8 @@ The latest full release of Circle is 2.20, released on November 17, 1993. -Currently 3.0 is in beta, at patch level 16, released on August 28, 1999. +Currently 3.0 is in beta, at patch level 18, released on March 18, 2001 +(3/18/2001, get it?). 1.5. What is the history of CircleMUD? @@ -289,7 +290,7 @@ o Version 2.11: September 19, 1993 o Version 2.20: November 17, 1993 -Version 3.00 is currently in beta right now and is up to patchlevel 16. The +Version 3.00 is currently in beta right now and is up to patchlevel 18. The final release is due out Real Soon Now(tm). Don't bother posting requests for it. It will be out when Jeremy gets it done, and it will be announced on the mailing list and the newsgroup rec.games.mud.diku. @@ -1140,7 +1141,7 @@ In /etc/rc.d/rc.local find where things like sendmail and (maybe) gpm are started. Add something like: -cd /home/mudlogin/circlebpl16/ +cd /home/mudlogin/circlebpl18/ su mudlogin -c ./autorun & cd @@ -1250,7 +1251,7 @@ 6. CircleMUD 3.0 Questions -6.1. Are there any bugs in patch level 16? +6.1. Are there any bugs in patch level 18? There are no bugs. Only features. Seriously though, if perchance you find a bug, please mail it (along with a possible fix) to the bugs database Index: circle/autorun diff -u circle/autorun:1.3 circle/autorun:1.5 --- circle/autorun:1.3 Wed Aug 26 15:55:03 1998 +++ circle/autorun Tue Jun 26 04:28:42 2001 @@ -2,6 +2,7 @@ # # CircleMUD 3.0 autorun script # Contributions by Fred Merkel, Stuart Lamble, and Jeremy Elson +# New log rotating code contributed by Peter Ajamian # Copyright (c) 1996 The Trustees of The Johns Hopkins University # All Rights Reserved # See license.doc for more information @@ -38,43 +39,112 @@ # of all flags). FLAGS='-q' +# Number of syslog.# files to keep in the log directory. +BACKLOGS=6 + +# Each record in the following variable contains information for one log file. +# The fields are filename:maxlines:pattern where filename is the name of the +# log file, maxlines is the maximum number of lines in the file (0 for +# unlimited) and pattern is a pattern which must be matched for a line to get +# copied from syslog to this log file. +LOGFILES=' +delete:0:self-delete +dts:0:death trap +rip:0:killed +restarts:0:Running +levels:0:advanced +rentgone:0:equipment lost +usage:0:usage +newplayers:0:new player +errors:0:SYSERR +godcmds:0:(GC) +badpws:0:Bad PW +' + +# The following is the number of lines in syslog.CRASH. Set to 0 to disable +# crashlogs. +LEN_CRASHLOG=30 + ############################################################################# +############# +# Functions # +############# + +# The proc_syslog function will grep the logs for the various different info +# and rotate the logs in the log directory. +proc_syslog () { + # Return if there's no syslog + if ! [ -s syslog ]; then return; fi + + # Create the crashlog + if [ -n "$LEN_CRASHLOG" -a "$LEN_CRASHLOG" -gt 0 ]; then + tail -n $LEN_CRASHLOG syslog > syslog.CRASH + fi + + # Append to the specialty logfiles and truncate to maximum length if + # applicable + OLD_IFS=$IFS + IFS=' +' + for rec in $LOGFILES; do + name=log/`echo $rec|cut -f 1 -d:` + len=`echo $rec|cut -f 2 -d:` + pattern=`echo $rec|cut -f 3- -d:` + + fgrep $pattern syslog >> $name + if [ $len -gt 0 ]; then + temp=`mktemp $name.XXXXXX` + tail -n $len $name > $temp + mv -f $temp $name + fi + done + IFS=$OLD_IFS + + # Find the # to set the new log file to. + if [ -s log/syslog.$BACKLOGS ]; then + declare -i newlog=$BACKLOGS+1 + else + declare -i newlog=1 + while [ -s log/syslog.$newlog ]; do newlog=$newlog+1; done + fi + + # Rotate the logs. + declare -i y=2 + while [ $y -lt $newlog ]; do + declare -i x=$y-1 + mv -f log/syslog.$y log/syslog.$x + y=$y+1 + done + mv -f syslog log/syslog.$newlog +} + + +######## +# Main # +######## + +# Check to see if there is a syslog which would indicate that autorun +# was improperly killed (ie maybe the system was rebooted or ?). +if [ -s syslog ]; then + echo Improper shutdown of autorun detected, rotating syslogs before startup. >> syslog + proc_syslog +fi + +# The main loop while ( : ) do DATE=`date` - echo "autorun starting game $DATE" >> syslog + echo "autorun starting game $DATE" > syslog echo "running bin/circle $FLAGS $PORT" >> syslog bin/circle $FLAGS $PORT >> syslog 2>&1 - tail -30 syslog > syslog.CRASH - - fgrep "self-delete" syslog >> log/delete - fgrep "death trap" syslog >> log/dts - fgrep "killed" syslog >> log/rip - fgrep "Running" syslog >> log/restarts - fgrep "advanced" syslog >> log/levels - fgrep "equipment lost" syslog >> log/rentgone - fgrep "usage" syslog >> log/usage - fgrep "new player" syslog >> log/newplayers - fgrep "SYSERR" syslog >> log/errors - fgrep "(GC)" syslog >> log/godcmds - fgrep "Bad PW" syslog >> log/badpws - - rm log/syslog.1 - mv log/syslog.2 log/syslog.1 - mv log/syslog.3 log/syslog.2 - mv log/syslog.4 log/syslog.3 - mv log/syslog.5 log/syslog.4 - mv log/syslog.6 log/syslog.5 - mv syslog log/syslog.6 - touch syslog - if [ -r .killscript ]; then DATE=`date`; echo "autoscript killed $DATE" >> syslog rm .killscript + proc_syslog exit fi @@ -82,11 +152,13 @@ sleep 60 else rm .fastboot - sleep 5 fi while [ -r pause ]; do sleep 60 done + + proc_syslog + sleep 5 done Index: circle/autorun.README diff -u /dev/null circle/autorun.README:1.1 --- /dev/null Tue Aug 14 21:55:15 2001 +++ circle/autorun.README Mon Jun 25 11:28:38 2001 @@ -0,0 +1,29 @@ +From: Peter Ajamian + +This is something I did a few weeks ago but didn't get around to +submitting it until now. Basically There have always been a few things +about the autorun script which have always irked me, this "improved" +version is my attempt to correct those deficiencies as well as to add a +little bit of extra functionality to the script. The script addresses +the following deficiencies: +- syslog rotation: When a new MUD is started an error is produced + during the syslog rotation after the first 6 times the MUD is run. This + is because there is no check for the existance of the files being + rotated. +- autorun crashes append to log instead of rotating: If autorun crashes, + or is manually killed, or a server reboot is done without first shutting + down the MUD then the new syslog will continue to append to the old one + instead of rotating the syslogs and starting a fresh one. This is + because the syslogs are currently rotated only _after_ the mud is + properly shut down. To correct for this I have allowed for syslog + rotation before the MUD boots as well. Also this script will detect + improper shutdown of autorun and make a note in the syslog before + rotating them. +- Better customization of grep-generated logs: Various options have been + added to the autorun script to allow for easy customization of + grep-generated logs. See the comments in the script for details. + +You may want to do some compatibility testing on varying platforms +because this uses various commands that were are not present in the +current autorun (cut, mktemp, and maybe others I can't think of now). +This script also uses functions. Index: circle/autorun.sh diff -u /dev/null circle/autorun.sh:1.1 --- /dev/null Tue Aug 14 21:55:15 2001 +++ circle/autorun.sh Mon Jun 25 11:28:38 2001 @@ -0,0 +1,92 @@ +#!/bin/sh +# +# CircleMUD 3.0 autorun script +# Contributions by Fred Merkel, Stuart Lamble, and Jeremy Elson +# Copyright (c) 1996 The Trustees of The Johns Hopkins University +# All Rights Reserved +# See license.doc for more information +# +############################################################################# +# +# This script can be used to run CircleMUD over and over again (i.e., have it +# automatically reboot if it crashes). It will run the game, and copy some +# of the more useful information from the system logs to the 'log' directory +# for safe keeping. +# +# You can control the operation of this script by creating and deleting files +# in Circle's root directory, either manually or by using the 'shutdown' +# command from within the MUD. +# +# Creating a file called .fastboot makes the script wait only 5 seconds +# between reboot attempts instead of the usual 60. If you want a quick +# reboot, use the "shutdown reboot" command from within the MUD. +# +# Creating a file called .killscript makes the script terminate (i.e., stop +# rebooting the MUD). If you want to shut down the MUD and make it stay +# shut down, use the "shutdown die" command from within the MUD. +# +# Finally, if a file called pause exists, the script will not reboot the MUD +# again until pause is removed. This is useful if you want to turn the MUD +# off for a couple of minutes and then bring it back up without killing the +# script. Type "shutdown pause" from within the MUD to activate this feature. +# + +# The port on which to run the MUD +PORT=4000 + +# Default flags to pass to the MUD server (see admin.txt for a description +# of all flags). +FLAGS='-q' + +############################################################################# + +while ( : ) do + + DATE=`date` + echo "autorun starting game $DATE" >> syslog + echo "running bin/circle $FLAGS $PORT" >> syslog + + bin/circle $FLAGS $PORT >> syslog 2>&1 + + tail -30 syslog > syslog.CRASH + + fgrep "self-delete" syslog >> log/delete + fgrep "death trap" syslog >> log/dts + fgrep "killed" syslog >> log/rip + fgrep "Running" syslog >> log/restarts + fgrep "advanced" syslog >> log/levels + fgrep "equipment lost" syslog >> log/rentgone + fgrep "usage" syslog >> log/usage + fgrep "new player" syslog >> log/newplayers + fgrep "SYSERR" syslog >> log/errors + fgrep "(GC)" syslog >> log/godcmds + fgrep "Bad PW" syslog >> log/badpws + + rm log/syslog.1 + mv log/syslog.2 log/syslog.1 + mv log/syslog.3 log/syslog.2 + mv log/syslog.4 log/syslog.3 + mv log/syslog.5 log/syslog.4 + mv log/syslog.6 log/syslog.5 + mv syslog log/syslog.6 + touch syslog + + if [ -r .killscript ]; then + DATE=`date`; + echo "autoscript killed $DATE" >> syslog + rm .killscript + exit + fi + + if [ ! -r .fastboot ]; then + sleep 60 + else + rm .fastboot + sleep 5 + fi + + while [ -r pause ]; do + sleep 60 + done + +done Index: circle/doc/README.BORLAND diff -u circle/doc/README.BORLAND:1.2 circle/doc/README.BORLAND:1.3 --- circle/doc/README.BORLAND:1.2 Wed Oct 28 17:17:41 1998 +++ circle/doc/README.BORLAND Thu May 24 05:37:10 2001 @@ -8,7 +8,8 @@ These instructions will not work using Turbo C++, or the 4.0 versions of Borland C++ as those two products were geared twoards DOS and Windows 3.xx. -It will most likely work with versions 5.00 and 5.02 of Borland C++ compilers. +It will most likely work with versions 5.00, 5.02, and 5.5 of the Borland +C++ compilers. Boot up your Windows 95 machine. @@ -18,16 +19,29 @@ (Type) rename conf.h.win conf.h (Enter) +** BORLAND 5.5 ** +If you are using Borland C++ 5.5, a couple of extra changes need to be +made at this time. First you have to make sure the bin directory of the +tools is in your path. You can add the following line to your autoexec.bat +to have it automatically added to your path or you can type it at a DOS +prompt: + path = %path%;c:\borland\bcc55\bin + +(Type) make -fmakefile.bcc55 (Enter) + +** BORLAND 5.1 ** (Type) make -fmakefile.bcc (Enter) - Something to note here is that this makefile - assumes that you have installed Borland C++ 5.01 +** End Version Specifics ** + + Something to note here is that these makefile + assume that you have installed Borland C++ 5.x to the C: drive. If you have installed it to - another drive you will have to open up - Makefile.bcc in a text editor and find and - replace all C:\ references to the drive letter - it has been installed to. - + another drive you will have to open up the correct + Makefile in a text editor and find and replace + all C:\ references to the drive letter it has + been installed to. + (Type) move circle.exe ..\ (Enter) (Type) cd .. (Enter) @@ -48,4 +62,5 @@ Pat yourself on the back. --- -Mundi King 98-07-03 +Mundi King 1998-07-03 +Updated for 5.5: 2000-06-28 Index: circle/doc/README.CYGWIN diff -u circle/doc/README.CYGWIN:1.4 circle/doc/README.CYGWIN:1.5 --- circle/doc/README.CYGWIN:1.4 Sun Jan 23 19:44:18 2000 +++ circle/doc/README.CYGWIN Sun Mar 18 19:39:25 2001 @@ -32,14 +32,14 @@ 3) Download and uncompress the latest version of CircleMUD according to the instructions in the main README file. (The FTP site is ftp.circlemud.org, in the pub/CircleMUD directory). Make sure that if you have downloaded the - "zipped" version (circle30bpl18.zip, or example), that you use an unzip + "zipped" version (circle30bpl19.zip, or example), that you use an unzip program which can handle long file names to unzip it (like the Win32 version of Info-Zip's "unzip"). Otherwise, download ther "tarred, gzipped" version - (circle30bpl18.tar.gz), and extract the files using the versions of tar and + (circle30bpl19.tar.gz), and extract the files using the versions of tar and gunzip which come with the full Cygwin package. 4) Start the "bash" shell and go to the directory where you have extracted - CircleMUD (we will assume "C:\circle30bpl18", or "/circle30bpl18" from + CircleMUD (we will assume "C:\circle30bpl19", or "/circle30bpl19" from within bash). DO NOT go into the "src" directory yet. 5) Run the shell script "./configure". This will automatically detect @@ -51,9 +51,9 @@ an executable, you can also try "sh configure", "sh ./configure", "bash configure" and "bash ./configure" until one of them works. -6) NOW change to the /circle30bpl18/src directory, and type "make", and watch +6) NOW change to the /circle30bpl19/src directory, and type "make", and watch CircleMUD and the additional utilies included in the Circle distribution - automatically being compiled and placed in /circle30bpl18/bin. + automatically being compiled and placed in /circle30bpl19/bin. 7) Make sure your TCP/IP stack is installed, correctly configured, and running. If you are already using TCP/IP applications from your Windows machine such @@ -68,7 +68,7 @@ YOU MUST INSTALL AND CONFIGURE YOUR TCP/IP STACK, EVEN IF YOU ARE NOT CONNECTED TO THE INTERNET. -8) Go back to /circle30bpl18, and run the MUD either directly by typing +8) Go back to /circle30bpl19, and run the MUD either directly by typing "bin/circle", or by using the "./autorun" script. 9) Start a telnet program (SEE NOTE BELOW). Open a connection to your @@ -105,7 +105,7 @@ answered in this README file, or in other documents included in the CircleMUD distribution. If you are still having problems and you're *sure* that this your question is not answered in this document or in one of the others files -in the /circle30bpl18/doc directory, try reading the CircleMUD FAQ at +in the /circle30bpl19/doc directory, try reading the CircleMUD FAQ at ftp://ftp.circlemud.org/pub/CircleMUD/FAQ. If all else fails, you can send me or Jeremy Elson mail for help. Note, however, that if you ask me any question that is answered in these documents, all we'll do is mail you the appropriate Index: circle/doc/README.WIN diff -u circle/doc/README.WIN:1.6 circle/doc/README.WIN:1.7 --- circle/doc/README.WIN:1.6 Sun Aug 22 15:56:50 1999 +++ circle/doc/README.WIN Wed May 9 05:44:04 2001 @@ -19,6 +19,8 @@ compiler, you can just download this one off the net and get Circle up and running in no time. Read the file README.CYGWIN (submitted by David Goldstein ). + Please note however that the CYGWIN system is not recommended + for those unfamiliar with the Unix environment. 2. Microsoft Visual C++ version 4.x -- read the file README.MSVC4 Index: circle/doc/building.txt diff -u circle/doc/building.txt:1.1 circle/doc/building.txt:1.3 --- circle/doc/building.txt:1.1 Tue Oct 28 21:16:10 1997 +++ circle/doc/building.txt Tue Aug 14 21:49:06 2001 @@ -1568,7 +1568,7 @@ ______________________________________________________________________ # ~ - + {zero or more zone commands} S ______________________________________________________________________ @@ -1588,11 +1588,14 @@ A label given to the zone so that it can be identified in system logs. + Bottom Room Number + The lowest numbered room belonging to this zone. For zone N, + this should be a larger number than TopRoom(zone N-1). + Top Room Number The highest numbered room belonging to this zone. A room with - virtual number V belongs to zone N if TopRoom(zone N-1) < V <= - TopRoom(zone N) for all N > 0. Rooms belong to zone 0 if their - number is between 0 and the top of zone 0. + virtual number V belongs to zone N if BottomRoom(zone N) <= V <= + TopRoom(zone N) for all N > 0. Lifespan The number of real-time minutes between zone resets for this Index: circle/doc/coding.doc diff -u circle/doc/coding.doc:1.1.1.1 circle/doc/coding.doc:1.3 --- circle/doc/coding.doc:1.1.1.1 Tue Feb 6 12:24:02 1996 +++ circle/doc/coding.doc Thu May 17 07:50:51 2001 @@ -13,9 +13,9 @@ Summary: A guide to writing C code for use with CircleMUD. Includes a description of commonly used functions, tips on how to add new commands and -spells, and other commonly asked coding questions. Good familiarity with both -C and UNIX is assumed, although system-level UNIX C programming skill not -required. +spells, and other commonly asked coding questions. Good familiarity with +both C and UNIX is assumed, although system-level UNIX C programming skill +not required. Area-building not covered (see building.doc). Intended Audience: @@ -48,6 +48,8 @@ 4.4. The Special Procedure Function Header 4.5. The Special Procedure Return Value +Note: Section 4 written by Luis Pedro Passos Carvalho + --------------------------------------------------------------------------- @@ -292,7 +294,6 @@ practical code examples. - 2.2. The Way Things Work -- Overview 2.3. CircleMUD's Global Variables 2.4. Frequently Used Functions @@ -309,8 +310,123 @@ 4. Writing Special Procedures + + Special procedures are the way to give life to your world. Through +special procedures you can, for instance, make Mobiles react to player +actions, fight inteligently,etc. + Using special procedures, your virtual world is not just a bunch of +monsters, objects and rooms, reduced to a number of statistics. Just like +good descriptions add atmosphere to the world, good use of special +procedures adds flesh and life to the world. + Several special procedures are provided with stock CircleMud which you +can use to create your own and get used to the mechanics of special +procedures. These special procedures can be found in castle.c and +spec_procs.c. They range from very simple procedures, like puff (pulsed +special procedure) or bank (command-driven special procedure), to very +complex procedures like the guildmaster. + In this chapter, false refers to the value 0 and true to any non-zero +value. + 4.1. Overview of Special Procedures -4.2. Pulsed vs. Command-Drive Special Procedures + + Special procedures are nothing more than C functions, which are +associated to mobiles, objects and rooms. + In the standard version of CircleMUD, special procedures are defined +and assigned at compile time and cannot be changed or reassigned during +runtime. + +4.2. Pulsed vs. Command-Driven Special Procedures + + Special procedures are called at three points in code: the command +interpreter (command-driven special procedures), the game heartbeat and the +violence code (pulsed special procedures). + There is no information kept to know if the special procedure is +pulsed or command-driven, other than the behaviour of the special procedure +itself. When creating a special procedure you must keep in mind that it will +be called in each of the three places and must therefore be prepared to react +to all situations accordingly. + In the next two sub-sections we will present both types of special +procedures, and in the third sub-section we'll explain how to diferentiate +the three types of call. + +4.2.1. Pulsed Special Procedures + + Every tick, the function heartbeat goes through the list of mobiles +and the list of objects, updating everyone of them. If a mobile or an object +as a special procedure associated to it, that special procedure is run with +the parameters cmd and argument set to 0 and NULL respectively. The NULL +used to be sent as an empty string (""), but this was changed in 3.0bpl19. + When there is a fight, the special procedure of a fighting mobile is +called once per round with the same arguments. + +4.2.2. Command Driven Special Procedures + + Whenever a player issues a command, the command interpreter tries to +identify it in the Master Command Table. If it succeeds, before running the +command associated in the table, it checks for special procedures in the +following order: + * room the player is in; + * objects in the player's equipment (does not enter the containers); + * objects in the player's inventory (does not enter the containers); + * mobiles in the room; + * objects in the room floor; + The first special procedure to succeed and return true finishes the +interpreting of the command. + If no special procedure returned true or no special procedure was +found, then the command interpreter runs the procedure specified in the +Master Command Table. + +4.2.3. Preparing for all occurrences + + In order to make your special procedure react accordingly to all the +different places where the special procedure can be called you need to +distinguish those places. The way to do it is through the parameters. + Whenever cmd is 0, the special procedure has been called as a pulsed +special procedure, otherwise it's a command-driven special procedure. + To detect if the procedure was called through the violence code, it +is a pulsed special procedure and IS_FIGHTING(me) must be true. Of course, +this only has meaning for a mobile special procedure. + 4.3. Relating Special Procedures to Objects, Mobiles, and Rooms + + The special procedures are assigned to the prototypes of the objects +and mobiles, not to the instances themselves. There are functions provided +to assign the special procedures: + * ASSIGNMOB(,) + * ASSIGNOBJ(,) + * ASSIGNROOM(,) + Stock CircleMUD also provides a place where to put all the special +procedure assignments: the functions assign_mobiles, assign_objects and +assign_rooms in spec_assign.c. + 4.4. The Special Procedure Function Header + + The function header of any special procedure is defined in the macro +SPECIAL() and is as follows: + int ()(struct char_data *ch, void *me, int cmd, char *argument) +where is the name of the special procedure. + The parameters to the function are: + ch : Character that issued the command to command interpreter that + triggered this special procedure. + me : The mobile, object or room to which the special procedure is + given. + cmd : The command that ch issued as recognized by the command + interpreter, or zero if the special procedure is being called + by the pulse code. + argument : The command that the played has introduced at the prompt + or an empty string if the special procedure is being + called by the pulse code. + 4.5. The Special Procedure Return Value + + The return value of a special procedure is looked at only by the +command interpreter and has meaning only for command-driven special +procedures. Pulsed special procedures should always return false. + A command-driven special procedure can return two values: + false : The procedure did not process the command given and it + should be processed in the standard way by the command + interpreter. + true : The procedure reacted to the command given and so, the + command interpreter should ignore it. + + Index: circle/lib/etc/.cvsignore diff -u circle/lib/etc/.cvsignore:1.2 circle/lib/etc/.cvsignore:1.4 --- circle/lib/etc/.cvsignore:1.2 Tue Jun 30 21:35:54 1998 +++ circle/lib/etc/.cvsignore Tue Aug 14 18:02:14 2001 @@ -1,2 +1,5 @@ +hcontrol players plrmail +badsites +board.immort Index: circle/lib/world/zone.lst diff -u circle/lib/world/zone.lst:1.2 circle/lib/world/zone.lst:1.3 --- circle/lib/world/zone.lst:1.2 Tue Oct 28 21:16:13 1997 +++ circle/lib/world/zone.lst Fri May 18 11:41:09 2001 @@ -2,11 +2,11 @@ ************** 0 - Limbo - Internal 54 - New Thalos -9 - The River Island 55 - New Thalos -12 - God Simplex 56 - New Thalos Wilderness +9 - The River Island 55 - New Thalos (Cont) +12 - God Simplex 56 - New Thalos (Cont) 15 - The Straight Path 60 - Haon-Dor-Light Forest 25 - High Tower Of Sorcery 61 - Haon-Dor-Dark Forest -26 - High Tower Of Sorcery 62 - Orc Enclave +26 - High Tower Of Sorcery (Cont) 62 - Orc Enclave 30 - Midgaard City 63 - Arachnos 31 - Midgaard City 64 - Rand's Tower 32 - Midgaard River 65 - Dwarven Kingdom @@ -14,7 +14,7 @@ 35 - Miden'nir 71 - Sewers 36 - Chessboard 72 - Sewers 40 - Moria 73 - Sewers -41 - Moria 79 - Redferne's Residence +41 - Moria (Cont) 79 - Redferne's Residence 50 - Great Eastern Desert 120 - Rome 51 - Drow City 150 - King Welmar's Castle 52 - Old Thalos 186 - Newbie Zone Index: circle/lib/world/wld/186.wld diff -u circle/lib/world/wld/186.wld:1.2 circle/lib/world/wld/186.wld:1.3 --- circle/lib/world/wld/186.wld:1.2 Fri Dec 15 17:44:07 2000 +++ circle/lib/world/wld/186.wld Fri May 18 11:15:41 2001 @@ -868,5 +868,4 @@ They are constructed of smooth, beautiful marble. ~ S - $ Index: circle/lib/world/wld/25.wld diff -u circle/lib/world/wld/25.wld:1.2 circle/lib/world/wld/25.wld:1.3 --- circle/lib/world/wld/25.wld:1.2 Sun Dec 17 06:23:50 2000 +++ circle/lib/world/wld/25.wld Fri May 18 11:15:42 2001 @@ -3323,5 +3323,4 @@ ~ 0 -1 3001 S - $ Index: circle/lib/world/wld/33.wld diff -u circle/lib/world/wld/33.wld:1.1.1.1 circle/lib/world/wld/33.wld:1.2 --- circle/lib/world/wld/33.wld:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/wld/33.wld Fri May 18 11:15:42 2001 @@ -1526,4 +1526,3 @@ 0 -1 3374 S $ - Index: circle/lib/world/wld/36.wld diff -u circle/lib/world/wld/36.wld:1.1.1.1 circle/lib/world/wld/36.wld:1.2 --- circle/lib/world/wld/36.wld:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/wld/36.wld Fri May 18 11:15:42 2001 @@ -1594,5 +1594,4 @@ marble square~ 2 3615 3660 S - $ Index: circle/lib/world/wld/40.wld diff -u circle/lib/world/wld/40.wld:1.1.1.1 circle/lib/world/wld/40.wld:1.2 --- circle/lib/world/wld/40.wld:1.1.1.1 Sat Apr 13 17:07:30 1996 +++ circle/lib/world/wld/40.wld Fri May 18 11:15:42 2001 @@ -1916,4 +1916,3 @@ 0 -1 4118 S $ - Index: circle/lib/world/wld/50.wld diff -u circle/lib/world/wld/50.wld:1.3 circle/lib/world/wld/50.wld:1.4 --- circle/lib/world/wld/50.wld:1.3 Mon Dec 4 05:12:00 2000 +++ circle/lib/world/wld/50.wld Fri May 18 11:15:42 2001 @@ -1481,4 +1481,3 @@ 0 -1 5009 S $ - Index: circle/lib/world/wld/53.wld diff -u circle/lib/world/wld/53.wld:1.1.1.1 circle/lib/world/wld/53.wld:1.2 --- circle/lib/world/wld/53.wld:1.1.1.1 Sat Apr 13 17:07:30 1996 +++ circle/lib/world/wld/53.wld Fri May 18 11:15:42 2001 @@ -1463,4 +1463,3 @@ 0 -1 5358 S $~ - Index: circle/lib/world/wld/54.wld diff -u circle/lib/world/wld/54.wld:1.2 circle/lib/world/wld/54.wld:1.3 --- circle/lib/world/wld/54.wld:1.2 Tue Oct 28 21:16:16 1997 +++ circle/lib/world/wld/54.wld Fri May 18 11:15:42 2001 @@ -5164,5 +5164,4 @@ grate~ 1 -1 5698 S - $ Index: circle/lib/world/wld/62.wld diff -u circle/lib/world/wld/62.wld:1.1.1.1 circle/lib/world/wld/62.wld:1.2 --- circle/lib/world/wld/62.wld:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/wld/62.wld Fri May 18 11:15:42 2001 @@ -1484,4 +1484,3 @@ 1 6200 6266 S $ - Index: circle/lib/world/wld/64.wld diff -u circle/lib/world/wld/64.wld:1.1.1.1 circle/lib/world/wld/64.wld:1.2 --- circle/lib/world/wld/64.wld:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/wld/64.wld Fri May 18 11:15:42 2001 @@ -843,4 +843,3 @@ 0 -1 6444 S $ - Index: circle/lib/world/zon/0.zon diff -u circle/lib/world/zon/0.zon:1.3 circle/lib/world/zon/0.zon:1.4 --- circle/lib/world/zon/0.zon:1.3 Sat Dec 2 07:58:12 2000 +++ circle/lib/world/zon/0.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #0 Limbo - Internal~ -99 10 2 +0 99 10 2 * * Mobiles M 0 1 1 1 Puff Index: circle/lib/world/zon/12.zon diff -u circle/lib/world/zon/12.zon:1.1.1.1 circle/lib/world/zon/12.zon:1.2 --- circle/lib/world/zon/12.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/12.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #12 God Simplex~ -1299 10 2 +1200 1299 10 2 * * Edited and added to by Taz of Tazmania * Index: circle/lib/world/zon/120.zon diff -u circle/lib/world/zon/120.zon:1.1.1.1 circle/lib/world/zon/120.zon:1.2 --- circle/lib/world/zon/120.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/120.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #120 Rome~ -12099 45 2 +12000 12099 45 2 * * Created by Onivel of Jedi * Index: circle/lib/world/zon/15.zon diff -u circle/lib/world/zon/15.zon:1.2 circle/lib/world/zon/15.zon:1.3 --- circle/lib/world/zon/15.zon:1.2 Sat Dec 2 07:58:12 2000 +++ circle/lib/world/zon/15.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #15 The Straight Path~ -1599 10 2 +1500 1599 10 2 * * By Steppin, Originally For ChicagoMUD 4-94 * Hopefully Final Version For JediMUD 12-95 Index: circle/lib/world/zon/150.zon diff -u circle/lib/world/zon/150.zon:1.2 circle/lib/world/zon/150.zon:1.3 --- circle/lib/world/zon/150.zon:1.2 Tue Oct 28 21:16:16 1997 +++ circle/lib/world/zon/150.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #150 King Welmar's Castle~ -15099 120 2 +15000 15099 120 2 * * Created by Pjotr and Sapowox of CircleMUD * Index: circle/lib/world/zon/186.zon diff -u circle/lib/world/zon/186.zon:1.1.1.1 circle/lib/world/zon/186.zon:1.2 --- circle/lib/world/zon/186.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/186.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #186 Newbie Zone~ -18699 10 2 +18600 18699 10 2 * * Created by Maynard of StrangeMUD * Index: circle/lib/world/zon/25.zon diff -u circle/lib/world/zon/25.zon:1.2 circle/lib/world/zon/25.zon:1.3 --- circle/lib/world/zon/25.zon:1.2 Sat Dec 2 07:58:12 2000 +++ circle/lib/world/zon/25.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #25 The High Tower Of Magic~ -2699 20 2 +2500 2699 20 2 * * Created for SillyMUD by Skylar * Index: circle/lib/world/zon/26.zon diff -u circle/lib/world/zon/26.zon:1.1.1.1 circle/lib/world/zon/26.zon:removed --- circle/lib/world/zon/26.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/26.zon Tue Aug 14 21:55:15 2001 @@ -1,9 +0,0 @@ -#26 -The High Tower Of Magic II~ -2699 0 0 -* -* This may be an empty zone file, but don't use the zone since the -* world and objects files are already in use. (= -* -S -$ Index: circle/lib/world/zon/30.zon diff -u circle/lib/world/zon/30.zon:1.1.1.1 circle/lib/world/zon/30.zon:1.2 --- circle/lib/world/zon/30.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/30.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #30 Northern Midgaard Main City~ -3099 15 2 +3000 3099 15 2 * * Mobiles M 0 3000 1 3033 Wizard Shop Keeper Index: circle/lib/world/zon/31.zon diff -u circle/lib/world/zon/31.zon:1.2 circle/lib/world/zon/31.zon:1.3 --- circle/lib/world/zon/31.zon:1.2 Sat Dec 2 07:47:04 2000 +++ circle/lib/world/zon/31.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #31 Southern part of Midgaard~ -3299 40 2 +3100 3299 40 2 * * Cityguards from zone 30 M 0 3060 20 3111 Cityguard Index: circle/lib/world/zon/33.zon diff -u circle/lib/world/zon/33.zon:1.3 circle/lib/world/zon/33.zon:1.4 --- circle/lib/world/zon/33.zon:1.3 Sat Dec 2 07:47:04 2000 +++ circle/lib/world/zon/33.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #33 The Three Of Swords~ -3399 30 2 +3300 3399 30 2 * * Created by Amanda Eterniale & Builder_5 of C.A.W. * Official C.A.W. site: http://qsilver.queensu.ca/~fletchra/Caw/ Index: circle/lib/world/zon/35.zon diff -u circle/lib/world/zon/35.zon:1.1.1.1 circle/lib/world/zon/35.zon:1.2 --- circle/lib/world/zon/35.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/35.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #35 Miden'Nir~ -3599 60 2 +3500 3599 60 2 * * Created by Copper II DikuMUD * Index: circle/lib/world/zon/36.zon diff -u circle/lib/world/zon/36.zon:1.1.1.1 circle/lib/world/zon/36.zon:1.2 --- circle/lib/world/zon/36.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/36.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #36 The Chessboard of Midgaard~ -3699 10 1 +3600 3699 10 1 * * Created for SillyMud by Exxon * Index: circle/lib/world/zon/40.zon diff -u circle/lib/world/zon/40.zon:1.3 circle/lib/world/zon/40.zon:1.5 --- circle/lib/world/zon/40.zon:1.3 Tue Feb 13 05:08:35 2001 +++ circle/lib/world/zon/40.zon Fri May 18 11:39:18 2001 @@ -1,6 +1,6 @@ #40 -Moria, Levels 1-2~ -4199 20 2 +Mines of Moria~ +4000 4198 20 2 * * Created for DikuMud * Heavily rewritten descriptions for CircleMud by Furry Index: circle/lib/world/zon/41.zon diff -u circle/lib/world/zon/41.zon:1.1.1.1 circle/lib/world/zon/41.zon:removed --- circle/lib/world/zon/41.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/41.zon Tue Aug 14 21:55:15 2001 @@ -1,9 +0,0 @@ -#41 -Moria, Level 3~ -4199 0 0 -* -* This may be an empty zone file, but don't use the zone since the -* world and objects files are already in use. (= -* -S -$ Index: circle/lib/world/zon/50.zon diff -u circle/lib/world/zon/50.zon:1.2 circle/lib/world/zon/50.zon:1.3 --- circle/lib/world/zon/50.zon:1.2 Tue Oct 28 21:16:17 1997 +++ circle/lib/world/zon/50.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #50 The Great Eastern Desert~ -5099 30 2 +5000 5099 30 2 * * Created by Rorschach of Alfa * Index: circle/lib/world/zon/51.zon diff -u circle/lib/world/zon/51.zon:1.2 circle/lib/world/zon/51.zon:1.3 --- circle/lib/world/zon/51.zon:1.2 Tue Oct 28 21:16:17 1997 +++ circle/lib/world/zon/51.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #51 Drow City~ -5199 30 1 +5100 5199 30 1 * * Created by Rorschach of Alfa * Index: circle/lib/world/zon/52.zon diff -u circle/lib/world/zon/52.zon:1.2 circle/lib/world/zon/52.zon:1.3 --- circle/lib/world/zon/52.zon:1.2 Tue Oct 28 21:16:17 1997 +++ circle/lib/world/zon/52.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #52 The City Of Thalos~ -5299 15 2 +5200 5299 15 2 * * Created by Rorschach of Alfa * Index: circle/lib/world/zon/53.zon diff -u circle/lib/world/zon/53.zon:1.1.1.1 circle/lib/world/zon/53.zon:1.2 --- circle/lib/world/zon/53.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/53.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #53 The Great Pyramid~ -5399 20 2 +5300 5399 20 2 * * Created by Andersen of HexOynx. * Index: circle/lib/world/zon/54.zon diff -u circle/lib/world/zon/54.zon:1.3 circle/lib/world/zon/54.zon:1.4 --- circle/lib/world/zon/54.zon:1.3 Sat Dec 2 07:58:12 2000 +++ circle/lib/world/zon/54.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #54 New Thalos~ -5699 20 2 +5400 5699 20 2 * * Created by Duke and Conner of SillyMud * Index: circle/lib/world/zon/55.zon diff -u circle/lib/world/zon/55.zon:1.1.1.1 circle/lib/world/zon/55.zon:removed --- circle/lib/world/zon/55.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/55.zon Tue Aug 14 21:55:15 2001 @@ -1,9 +0,0 @@ -#55 -New Thalos, Continued~ -5699 0 0 -* -* This may be an empty zone file, but don't use the zone since the -* world and objects files are already in use. (= -* -S -$ Index: circle/lib/world/zon/56.zon diff -u circle/lib/world/zon/56.zon:1.1.1.1 circle/lib/world/zon/56.zon:removed --- circle/lib/world/zon/56.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/56.zon Tue Aug 14 21:55:15 2001 @@ -1,9 +0,0 @@ -#56 -New Thalos Wilderness~ -5699 0 0 -* -* This may be an empty zone file, but don't use the zone since the -* world and objects files are already in use. (= -* -S -$ Index: circle/lib/world/zon/60.zon diff -u circle/lib/world/zon/60.zon:1.1.1.1 circle/lib/world/zon/60.zon:1.2 --- circle/lib/world/zon/60.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/60.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #60 Haon-Dor, Light Forest~ -6099 13 2 +6000 6099 13 2 * * Mobiles M 0 6000 1 6009 John The Lumberjack Index: circle/lib/world/zon/61.zon diff -u circle/lib/world/zon/61.zon:1.1.1.1 circle/lib/world/zon/61.zon:1.2 --- circle/lib/world/zon/61.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/61.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #61 Haon-Dor, Dark Forest~ -6199 30 2 +6100 6199 30 2 * Mobiles M 0 6100 2 6116 Vicious Warg M 0 6100 2 6116 Vicious Warg Index: circle/lib/world/zon/62.zon diff -u circle/lib/world/zon/62.zon:1.3 circle/lib/world/zon/62.zon:1.4 --- circle/lib/world/zon/62.zon:1.3 Sat Dec 2 07:47:04 2000 +++ circle/lib/world/zon/62.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #62 The Orc Enclave~ -6299 20 2 +6200 6299 20 2 * * Created by Builder_5 & Serene of C.A.W. * Official C.A.W. site: http://qsilver.queensu.ca/~fletchra/Caw/ Index: circle/lib/world/zon/63.zon diff -u circle/lib/world/zon/63.zon:1.1.1.1 circle/lib/world/zon/63.zon:1.2 --- circle/lib/world/zon/63.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/63.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #63 Arachnos~ -6399 34 2 +6300 6399 34 2 * * Created by Mahatma of HexOynx * Index: circle/lib/world/zon/64.zon diff -u circle/lib/world/zon/64.zon:1.3 circle/lib/world/zon/64.zon:1.4 --- circle/lib/world/zon/64.zon:1.3 Sat Dec 2 07:47:04 2000 +++ circle/lib/world/zon/64.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #64 Rand's Tower~ -6499 20 1 +6400 6499 20 1 * * Created by Amanda Eterniale of C.A.W. * Official C.A.W. site: http://qsilver.queensu.ca/~fletchra/Caw/ Index: circle/lib/world/zon/65.zon diff -u circle/lib/world/zon/65.zon:1.1.1.1 circle/lib/world/zon/65.zon:1.2 --- circle/lib/world/zon/65.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/65.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #65 The Dwarven Kingdom~ -6599 40 2 +6500 6599 40 2 * * Mobiles M 0 6500 11 6505 Dwarf Guard Index: circle/lib/world/zon/70.zon diff -u circle/lib/world/zon/70.zon:1.1.1.1 circle/lib/world/zon/70.zon:1.2 --- circle/lib/world/zon/70.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/70.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #70 The Sewer, First Level~ -7099 15 2 +7000 7099 15 2 * * Mobiles M 0 7001 9 7041 The Mean Bat Index: circle/lib/world/zon/71.zon diff -u circle/lib/world/zon/71.zon:1.1.1.1 circle/lib/world/zon/71.zon:1.2 --- circle/lib/world/zon/71.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/71.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #71 The Second Sewer~ -7199 20 2 +7100 7199 20 2 * * Mobiles M 0 7004 3 7102 The Earth Beetle Index: circle/lib/world/zon/72.zon diff -u circle/lib/world/zon/72.zon:1.1.1.1 circle/lib/world/zon/72.zon:1.2 --- circle/lib/world/zon/72.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/72.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #72 The Sewer Maze~ -7399 25 2 +7200 7299 25 2 * * Mobiles M 0 7200 1 7201 Master Mindflayer Index: circle/lib/world/zon/73.zon diff -u circle/lib/world/zon/73.zon:1.1.1.1 circle/lib/world/zon/73.zon:1.2 --- circle/lib/world/zon/73.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/73.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #73 The Tunnels In The Sewer~ -7399 25 2 +7300 7399 25 2 * * Mobiles M 0 7040 1 7328 The Red Dragon Index: circle/lib/world/zon/79.zon diff -u circle/lib/world/zon/79.zon:1.2 circle/lib/world/zon/79.zon:1.3 --- circle/lib/world/zon/79.zon:1.2 Thu Mar 30 12:35:28 2000 +++ circle/lib/world/zon/79.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #79 Redferne's Residence~ -7999 50 2 +7900 7999 50 2 * * Created for DikuMud * Index: circle/lib/world/zon/9.zon diff -u circle/lib/world/zon/9.zon:1.1.1.1 circle/lib/world/zon/9.zon:1.2 --- circle/lib/world/zon/9.zon:1.1.1.1 Sat Apr 13 17:07:31 1996 +++ circle/lib/world/zon/9.zon Fri May 18 11:12:57 2001 @@ -1,6 +1,6 @@ #9 River Island Of Minos~ -999 39 1 +900 999 39 1 * * Created by Mahatma of HexOynx * Index: circle/lib/world/zon/index diff -u circle/lib/world/zon/index:1.2 circle/lib/world/zon/index:1.3 --- circle/lib/world/zon/index:1.2 Tue Oct 28 21:16:17 1997 +++ circle/lib/world/zon/index Fri May 18 11:12:57 2001 @@ -3,21 +3,17 @@ 12.zon 15.zon 25.zon -26.zon 30.zon 31.zon 33.zon 35.zon 36.zon 40.zon -41.zon 50.zon 51.zon 52.zon 53.zon 54.zon -55.zon -56.zon 60.zon 61.zon 62.zon Index: circle/src/Makefile.bcc55 diff -u /dev/null circle/src/Makefile.bcc55:1.1 --- /dev/null Tue Aug 14 21:55:15 2001 +++ circle/src/Makefile.bcc55 Thu May 24 05:37:13 2001 @@ -0,0 +1,329 @@ +# For Borland C++ 5.5 +# +# Borland C++ IDE generated makefile +# Generated 12/26/97 at 5:04:53 AM +# +.AUTODEPEND + + +# +# Borland C++ tools +# +IMPLIB = Implib +BCC32 = Bcc32 +BCC32I = Bcc32i +TLINK32 = ILink32 +TLIB = TLib +BRC32 = Brc32 +TASM32 = Tasm32 +# +# IDE macros +# + + +# +# Options +# +IDE_LinkFLAGS32 = -LC:\BORLAND\BCC55\LIB +LinkerLocalOptsAtC32_circledexe = -Tpe -ap -c +ResLocalOptsAtC32_circledexe = +BLocalOptsAtC32_circledexe = +CompInheritOptsAt_circledexe = -IC:\BORLAND\BCC55\INCLUDE; +LinkerInheritOptsAt_circledexe = -x +LinkerOptsAt_circledexe = $(LinkerLocalOptsAtC32_circledexe) +ResOptsAt_circledexe = $(ResLocalOptsAtC32_circledexe) +BOptsAt_circledexe = $(BLocalOptsAtC32_circledexe) + +# +# Dependency List +# +Dep_circle = \ + circle.exe + +circle : BccW32.cfg $(Dep_circle) + echo MakeNode + +Dep_circledexe = \ + alias.obj\ + act.comm.obj\ + act.movement.obj\ + act.item.obj\ + act.informative.obj\ + act.offensive.obj\ + act.other.obj\ + boards.obj\ + ban.obj\ + act.wizard.obj\ + act.social.obj\ + castle.obj\ + class.obj\ + db.obj\ + constants.obj\ + config.obj\ + comm.obj\ + fight.obj\ + graph.obj\ + limits.obj\ + interpreter.obj\ + house.obj\ + handler.obj\ + magic.obj\ + mail.obj\ + olc.obj\ + objsave.obj\ + modify.obj\ + mobact.obj\ + random.obj\ + shop.obj\ + spells.obj\ + spell_parser.obj\ + spec_procs.obj\ + spec_assign.obj\ + utils.obj\ + weather.obj + +circle.exe : $(Dep_circledexe) + $(TLINK32) @&&| + /v $(IDE_LinkFLAGS32) $(LinkerOptsAt_circledexe) $(LinkerInheritOptsAt_circledexe) + +C:\BORLAND\BCC55\LIB\c0x32.obj+ +alias.obj+ +act.comm.obj+ +act.movement.obj+ +act.item.obj+ +act.informative.obj+ +act.offensive.obj+ +act.other.obj+ +boards.obj+ +ban.obj+ +act.wizard.obj+ +act.social.obj+ +castle.obj+ +class.obj+ +db.obj+ +constants.obj+ +config.obj+ +comm.obj+ +fight.obj+ +graph.obj+ +limits.obj+ +interpreter.obj+ +house.obj+ +handler.obj+ +magic.obj+ +mail.obj+ +olc.obj+ +objsave.obj+ +modify.obj+ +mobact.obj+ +random.obj+ +shop.obj+ +spells.obj+ +spell_parser.obj+ +spec_procs.obj+ +spec_assign.obj+ +utils.obj+ +weather.obj +$<,$* +C:\BORLAND\BCC55\LIB\import32.lib+ +C:\BORLAND\BCC55\LIB\cw32i.lib + +| +alias.obj : alias.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ alias.c +| + +act.comm.obj : act.comm.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.comm.c +| + +act.movement.obj : act.movement.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.movement.c +| + +act.item.obj : act.item.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.item.c +| + +act.informative.obj : act.informative.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.informative.c +| + +act.offensive.obj : act.offensive.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.offensive.c +| + +act.other.obj : act.other.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.other.c +| + +boards.obj : boards.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ boards.c +| + +ban.obj : ban.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ ban.c +| + +act.wizard.obj : act.wizard.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.wizard.c +| + +act.social.obj : act.social.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ act.social.c +| + +castle.obj : castle.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ castle.c +| + +class.obj : class.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ class.c +| + +db.obj : db.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ db.c +| + +constants.obj : constants.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ constants.c +| + +config.obj : config.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ config.c +| + +comm.obj : comm.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ comm.c +| + +fight.obj : fight.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ fight.c +| + +graph.obj : graph.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ graph.c +| + +limits.obj : limits.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ limits.c +| + +interpreter.obj : interpreter.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ interpreter.c +| + +house.obj : house.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ house.c +| + +handler.obj : handler.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ handler.c +| + +magic.obj : magic.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ magic.c +| + +mail.obj : mail.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ mail.c +| + +olc.obj : olc.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ olc.c +| + +objsave.obj : objsave.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ objsave.c +| + +modify.obj : modify.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ modify.c +| + +mobact.obj : mobact.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ mobact.c +| + +random.obj : random.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ random.c +| + +shop.obj : shop.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ shop.c +| + +spells.obj : spells.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ spells.c +| + +spell_parser.obj : spell_parser.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ spell_parser.c +| + +spec_procs.obj : spec_procs.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ spec_procs.c +| + +spec_assign.obj : spec_assign.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ spec_assign.c +| + +utils.obj : utils.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ utils.c +| + +weather.obj : weather.c + $(BCC32) -P- -c @&&| + $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ weather.c +| + +# Compiler configuration file +BccW32.cfg : + Copy &&| +-w +-R +-v +-vi +-H +-H=circle.csm +-WC +-g0 +| $@ + + Index: circle/src/Makefile.in diff -u circle/src/Makefile.in:1.14 circle/src/Makefile.in:1.15 --- circle/src/Makefile.in:1.14 Thu Jan 25 16:38:56 2001 +++ circle/src/Makefile.in Tue May 8 11:35:49 2001 @@ -85,11 +85,11 @@ @echo Creating .h.html files... @for file in *.h ; do \ echo $$file ; \ - cat /home/jelson/mud/htmlh-head $$file /home/jelson/mud/htmlh-tail > doc/$$file.html ; \ + cat htmlh-head $$file htmlh-tail > doc/$$file.html ; \ done # Copy over to the html directory - cp doc/*.html /home/jelson/public_html/circle/cdp/cxref - chmod 644 /home/jelson/public_html/circle/cdp/cxref/*.html + #cp doc/*.html $(HOME)/www/cxref + #chmod 644 $(HOME)/www/cxref/*.html # Dependencies for the object files (automagically generated with # gcc -MM) Index: circle/src/Makefile.lcc diff -u circle/src/Makefile.lcc:1.6 circle/src/Makefile.lcc:1.7 --- circle/src/Makefile.lcc:1.6 Sun Jan 23 19:43:14 2000 +++ circle/src/Makefile.lcc Sun Mar 18 19:41:39 2001 @@ -12,7 +12,7 @@ # thus less clutter on the screen during the make LCCDIR=c:\lccpub -DISTDIR=c:\circle30bpl18 +DISTDIR=c:\circle30bpl19 CFLAGS=-c -I$(LCCDIR)\include -DLCC_WIN32 CC=lcc OBJS=\ Index: circle/src/act.comm.c diff -u circle/src/act.comm.c:1.19 circle/src/act.comm.c:1.21 --- circle/src/act.comm.c:1.19 Thu Jan 25 16:50:43 2001 +++ circle/src/act.comm.c Tue Aug 14 17:54:08 2001 @@ -23,9 +23,6 @@ /* extern variables */ extern int level_can_shout; extern int holler_move_cost; -extern struct room_data *world; -extern struct descriptor_data *descriptor_list; -extern struct char_data *character_list; /* local functions */ void perform_tell(struct char_data *ch, struct char_data *vict, char *arg); @@ -244,9 +241,6 @@ } } - - -#define MAX_NOTE_LENGTH 1000 /* arbitrary */ ACMD(do_write) { Index: circle/src/act.informative.c diff -u circle/src/act.informative.c:1.33 circle/src/act.informative.c:1.45 --- circle/src/act.informative.c:1.33 Thu Jan 25 16:50:43 2001 +++ circle/src/act.informative.c Tue Aug 14 17:56:28 2001 @@ -26,10 +26,6 @@ extern struct help_index_element *help_table; extern char *help; extern struct time_info_data time_info; -extern struct room_data *world; -extern struct descriptor_data *descriptor_list; -extern struct char_data *character_list; -extern struct obj_data *object_list; extern char *credits; extern char *news; @@ -44,6 +40,7 @@ /* extern functions */ ACMD(do_action); +ACMD(do_insult); long find_class_bitvector(char arg); int level_exp(int chclass, int level); char *title_male(int chclass, int level); @@ -52,9 +49,11 @@ int compute_armor_class(struct char_data *ch); /* local functions */ -void print_object_location(int num, struct obj_data * obj, struct char_data * ch, int recur); -void show_obj_to_char(struct obj_data * object, struct char_data * ch, int mode); -void list_obj_to_char(struct obj_data * list, struct char_data * ch, int mode, int show); +int sort_commands_helper(const void *a, const void *b); +void print_object_location(int num, struct obj_data *obj, struct char_data *ch, int recur); +void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mode); +void list_obj_to_char(struct obj_data *list, struct char_data *ch, int mode, int show); +void show_obj_modifiers(struct obj_data *obj, struct char_data *ch); ACMD(do_look); ACMD(do_examine); ACMD(do_gold); @@ -67,8 +66,8 @@ ACMD(do_who); ACMD(do_users); ACMD(do_gen_ps); -void perform_mortal_where(struct char_data * ch, char *arg); -void perform_immort_where(struct char_data * ch, char *arg); +void perform_mortal_where(struct char_data *ch, char *arg); +void perform_immort_where(struct char_data *ch, char *arg); ACMD(do_where); ACMD(do_levels); ACMD(do_consider); @@ -77,72 +76,93 @@ ACMD(do_toggle); void sort_commands(void); ACMD(do_commands); -void diag_char_to_char(struct char_data * i, struct char_data * ch); -void look_at_char(struct char_data * i, struct char_data * ch); -void list_one_char(struct char_data * i, struct char_data * ch); -void list_char_to_char(struct char_data * list, struct char_data * ch); -void do_auto_exits(struct char_data * ch); +void diag_char_to_char(struct char_data *i, struct char_data *ch); +void look_at_char(struct char_data *i, struct char_data *ch); +void list_one_char(struct char_data *i, struct char_data *ch); +void list_char_to_char(struct char_data *list, struct char_data *ch); +void do_auto_exits(struct char_data *ch); ACMD(do_exits); -void look_in_direction(struct char_data * ch, int dir); -void look_in_obj(struct char_data * ch, char *arg); -char *find_exdesc(char *word, struct extra_descr_data * list); -void look_at_target(struct char_data * ch, char *arg); +void look_in_direction(struct char_data *ch, int dir); +void look_in_obj(struct char_data *ch, char *arg); +char *find_exdesc(char *word, struct extra_descr_data *list); +void look_at_target(struct char_data *ch, char *arg); +/* local globals */ +int *cmd_sort_info; -/* - * This function screams bitvector... -gg 6/45/98 - * - * A lot of "grep" later: - * Mode 0: Object description, and auras. - * Mode 1: Object short description and auras. - * Mode 2: Object short description and auras. - * Mode 3: Object short description. (Unused) - * Mode 4: Object short description and auras. (Unused) - * Mode 5: Notes, drink containers, fountains. - * Mode 6: Auras. - */ -void show_obj_to_char(struct obj_data * object, struct char_data * ch, - int mode) +/* For show_obj_to_char 'mode'. /-- arbitrary */ +#define SHOW_OBJ_LONG 0 +#define SHOW_OBJ_SHORT 1 +#define SHOW_OBJ_ACTION 2 + + +void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mode) { - *buf = '\0'; - if ((mode == 0) && object->description) - strcpy(buf, object->description); - else if (object->short_description && ((mode == 1) || - (mode == 2) || (mode == 3) || (mode == 4))) - strcpy(buf, object->short_description); - else if (mode == 5) { - if (GET_OBJ_TYPE(object) == ITEM_NOTE) { - if (object->action_description) { - strcpy(buf, "There is something written upon it:\r\n\r\n"); - strcat(buf, object->action_description); - page_string(ch->desc, buf, 1); + if (!obj || !ch) { + log("SYSERR: NULL pointer in show_obj_to_char(): obj=%p ch=%p", obj, ch); + return; + } + + switch (mode) { + case SHOW_OBJ_LONG: + send_to_char(obj->description, ch); + break; + + case SHOW_OBJ_SHORT: + send_to_char(obj->short_description, ch); + break; + + case SHOW_OBJ_ACTION: + switch (GET_OBJ_TYPE(obj)) { + case ITEM_NOTE: + if (obj->action_description) { + char notebuf[MAX_NOTE_LENGTH + 64]; + sprintf(notebuf, "There is something written on it:\r\n\r\n%.*s", MAX_NOTE_LENGTH, obj->action_description); + page_string(ch->desc, notebuf, TRUE); } else - send_to_char("It's blank.\r\n", ch); + send_to_char("It's blank.\r\n", ch); return; - } else if (GET_OBJ_TYPE(object) != ITEM_DRINKCON) { - strcpy(buf, "You see nothing special.."); - } else /* ITEM_TYPE == ITEM_DRINKCON||FOUNTAIN */ - strcpy(buf, "It looks like a drink container."); - } - if (mode != 3) { - if (IS_OBJ_STAT(object, ITEM_INVISIBLE)) - strcat(buf, " (invisible)"); - if (IS_OBJ_STAT(object, ITEM_BLESS) && AFF_FLAGGED(ch, AFF_DETECT_ALIGN)) - strcat(buf, " ..It glows blue!"); - if (IS_OBJ_STAT(object, ITEM_MAGIC) && AFF_FLAGGED(ch, AFF_DETECT_MAGIC)) - strcat(buf, " ..It glows yellow!"); - if (IS_OBJ_STAT(object, ITEM_GLOW)) - strcat(buf, " ..It has a soft glowing aura!"); - if (IS_OBJ_STAT(object, ITEM_HUM)) - strcat(buf, " ..It emits a faint humming sound!"); + + case ITEM_DRINKCON: + send_to_char("It looks like a drink container.", ch); + break; + + default: + send_to_char("You see nothing special..", ch); + break; + } + break; + + default: + log("SYSERR: Bad display mode (%d) in show_obj_to_char().", mode); + return; } - strcat(buf, "\r\n"); - page_string(ch->desc, buf, TRUE); + + show_obj_modifiers(obj, ch); + send_to_char("\r\n", ch); +} + + +void show_obj_modifiers(struct obj_data *obj, struct char_data *ch) +{ + if (OBJ_FLAGGED(obj, ITEM_INVISIBLE)) + send_to_char(" (invisible)", ch); + + if (OBJ_FLAGGED(obj, ITEM_BLESS) && AFF_FLAGGED(ch, AFF_DETECT_ALIGN)) + send_to_char(" ..It glows blue!", ch); + + if (OBJ_FLAGGED(obj, ITEM_MAGIC) && AFF_FLAGGED(ch, AFF_DETECT_MAGIC)) + send_to_char(" ..It glows yellow!", ch); + + if (OBJ_FLAGGED(obj, ITEM_GLOW)) + send_to_char(" ..It has a soft glowing aura!", ch); + + if (OBJ_FLAGGED(obj, ITEM_HUM)) + send_to_char(" ..It emits a faint humming sound!", ch); } -void list_obj_to_char(struct obj_data * list, struct char_data * ch, int mode, - int show) +void list_obj_to_char(struct obj_data *list, struct char_data *ch, int mode, int show) { struct obj_data *i; bool found = FALSE; @@ -158,7 +178,7 @@ } -void diag_char_to_char(struct char_data * i, struct char_data * ch) +void diag_char_to_char(struct char_data *i, struct char_data *ch) { int percent; @@ -191,7 +211,7 @@ } -void look_at_char(struct char_data * i, struct char_data * ch) +void look_at_char(struct char_data *i, struct char_data *ch) { int j, found; struct obj_data *tmp_obj; @@ -216,8 +236,8 @@ act("$n is using:", FALSE, i, 0, ch, TO_VICT); for (j = 0; j < NUM_WEARS; j++) if (GET_EQ(i, j) && CAN_SEE_OBJ(ch, GET_EQ(i, j))) { - send_to_char(where[j], ch); - show_obj_to_char(GET_EQ(i, j), ch, 1); + send_to_char(wear_where[j], ch); + show_obj_to_char(GET_EQ(i, j), ch, SHOW_OBJ_SHORT); } } if (ch != i && (IS_THIEF(ch) || GET_LEVEL(ch) >= LVL_IMMORT)) { @@ -225,7 +245,7 @@ act("\r\nYou attempt to peek at $s inventory:", FALSE, i, 0, ch, TO_VICT); for (tmp_obj = i->carrying; tmp_obj; tmp_obj = tmp_obj->next_content) { if (CAN_SEE_OBJ(ch, tmp_obj) && (number(0, 20) < GET_LEVEL(ch))) { - show_obj_to_char(tmp_obj, ch, 1); + show_obj_to_char(tmp_obj, ch, SHOW_OBJ_SHORT); found = TRUE; } } @@ -236,7 +256,7 @@ } -void list_one_char(struct char_data * i, struct char_data * ch) +void list_one_char(struct char_data *i, struct char_data *ch) { const char *positions[] = { " is lying here, dead.", @@ -320,7 +340,7 @@ -void list_char_to_char(struct char_data * list, struct char_data * ch) +void list_char_to_char(struct char_data *list, struct char_data *ch) { struct char_data *i; @@ -335,7 +355,7 @@ } -void do_auto_exits(struct char_data * ch) +void do_auto_exits(struct char_data *ch) { int door, slen = 0; @@ -391,7 +411,7 @@ -void look_at_room(struct char_data * ch, int ignore_brief) +void look_at_room(struct char_data *ch, int ignore_brief) { if (!ch->desc) return; @@ -425,7 +445,7 @@ /* now list characters & objects */ send_to_char(CCGRN(ch, C_NRM), ch); - list_obj_to_char(world[ch->in_room].contents, ch, 0, FALSE); + list_obj_to_char(world[ch->in_room].contents, ch, SHOW_OBJ_LONG, FALSE); send_to_char(CCYEL(ch, C_NRM), ch); list_char_to_char(world[ch->in_room].people, ch); send_to_char(CCNRM(ch, C_NRM), ch); @@ -433,7 +453,7 @@ -void look_in_direction(struct char_data * ch, int dir) +void look_in_direction(struct char_data *ch, int dir) { if (EXIT(ch, dir)) { if (EXIT(ch, dir)->general_description) @@ -454,7 +474,7 @@ -void look_in_obj(struct char_data * ch, char *arg) +void look_in_obj(struct char_data *ch, char *arg) { struct obj_data *obj = NULL; struct char_data *dummy = NULL; @@ -488,7 +508,7 @@ break; } - list_obj_to_char(obj->contains, ch, 2, TRUE); + list_obj_to_char(obj->contains, ch, SHOW_OBJ_SHORT, TRUE); } } else { /* item must be a fountain or drink container */ if (GET_OBJ_VAL(obj, 1) <= 0) @@ -509,7 +529,7 @@ -char *find_exdesc(char *word, struct extra_descr_data * list) +char *find_exdesc(char *word, struct extra_descr_data *list) { struct extra_descr_data *i; @@ -529,7 +549,7 @@ * Thanks to Angus Mezick for the * suggested fix to this problem. */ -void look_at_target(struct char_data * ch, char *arg) +void look_at_target(struct char_data *ch, char *arg) { int bits, found = FALSE, j, fnum, i = 0; struct char_data *found_char = NULL; @@ -598,9 +618,11 @@ /* If an object was found back in generic_find */ if (bits) { if (!found) - show_obj_to_char(found_obj, ch, 5); /* Show no-description */ - else - show_obj_to_char(found_obj, ch, 6); /* Find hum, glow etc */ + show_obj_to_char(found_obj, ch, SHOW_OBJ_ACTION); + else { + show_obj_modifiers(found_obj, ch); + send_to_char("\r\n", ch); + } } else if (!found) send_to_char("You do not see that here.\r\n", ch); } @@ -651,6 +673,7 @@ { struct char_data *tmp_char; struct obj_data *tmp_object; + char tempsave[MAX_INPUT_LENGTH]; one_argument(argument, arg); @@ -658,7 +681,9 @@ send_to_char("Examine what?\r\n", ch); return; } - look_at_target(ch, arg); + + /* look_at_target() eats the number. */ + look_at_target(ch, strcpy(tempsave, arg)); generic_find(arg, FIND_OBJ_INV | FIND_OBJ_ROOM | FIND_CHAR_ROOM | FIND_OBJ_EQUIP, ch, &tmp_char, &tmp_object); @@ -806,7 +831,7 @@ ACMD(do_inventory) { send_to_char("You are carrying:\r\n", ch); - list_obj_to_char(ch->carrying, ch, 1, TRUE); + list_obj_to_char(ch->carrying, ch, SHOW_OBJ_SHORT, TRUE); } @@ -818,11 +843,11 @@ for (i = 0; i < NUM_WEARS; i++) { if (GET_EQ(ch, i)) { if (CAN_SEE_OBJ(ch, GET_EQ(ch, i))) { - send_to_char(where[i], ch); - show_obj_to_char(GET_EQ(ch, i), ch, 1); + send_to_char(wear_where[i], ch); + show_obj_to_char(GET_EQ(ch, i), ch, SHOW_OBJ_SHORT); found = TRUE; } else { - send_to_char(where[i], ch); + send_to_char(wear_where[i], ch); send_to_char("Something.\r\n", ch); found = TRUE; } @@ -1102,7 +1127,6 @@ ACMD(do_users) { - const char *format = "%3d %-7s %-12s %-14s %-3s %-8s "; char line[200], line2[220], idletime[10], classname[20]; char state[30], *timeptr, mode; char name_search[MAX_INPUT_LENGTH], host_search[MAX_INPUT_LENGTH]; @@ -1220,16 +1244,11 @@ else strcpy(idletime, ""); - if (d->character && d->character->player.name) { - if (d->original) - sprintf(line, format, d->desc_num, classname, - d->original->player.name, state, idletime, timeptr); - else - sprintf(line, format, d->desc_num, classname, - d->character->player.name, state, idletime, timeptr); - } else - sprintf(line, format, d->desc_num, " - ", "UNDEFINED", - state, idletime, timeptr); + sprintf(line, "%3d %-7s %-12s %-14s %-3s %-8s ", d->desc_num, classname, + d->original && d->original->player.name ? d->original->player.name : + d->character && d->character->player.name ? d->character->player.name : + "UNDEFINED", + state, idletime, timeptr); if (d->host && *d->host) sprintf(line + strlen(line), "[%s]\r\n", d->host); @@ -1299,10 +1318,10 @@ } -void perform_mortal_where(struct char_data * ch, char *arg) +void perform_mortal_where(struct char_data *ch, char *arg) { - register struct char_data *i; - register struct descriptor_data *d; + struct char_data *i; + struct descriptor_data *d; if (!*arg) { send_to_char("Players in your Zone\r\n--------------------\r\n", ch); @@ -1335,7 +1354,7 @@ } -void print_object_location(int num, struct obj_data * obj, struct char_data * ch, +void print_object_location(int num, struct obj_data *obj, struct char_data *ch, int recur) { if (num > 0) @@ -1369,10 +1388,10 @@ -void perform_immort_where(struct char_data * ch, char *arg) +void perform_immort_where(struct char_data *ch, char *arg) { - register struct char_data *i; - register struct obj_data *k; + struct char_data *i; + struct obj_data *k; struct descriptor_data *d; int num = 0, found = 0; @@ -1627,50 +1646,28 @@ } -struct sort_struct { - int sort_pos; - byte is_social; -} *cmd_sort_info = NULL; - -int num_of_cmds; +int sort_commands_helper(const void *a, const void *b) +{ + return strcmp(cmd_info[*(const int *)a].command, cmd_info[*(const int *)b].command); +} void sort_commands(void) { - int a, b, tmp; - - num_of_cmds = 0; + int a, num_of_cmds = 0; - /* - * first, count commands (num_of_commands is actually one greater than the - * number of commands; it inclues the '\n'. - */ - while (*cmd_info[num_of_cmds].command != '\n') + while (cmd_info[num_of_cmds].command[0] != '\n') num_of_cmds++; + num_of_cmds++; /* \n */ - /* create data array */ - CREATE(cmd_sort_info, struct sort_struct, num_of_cmds); + CREATE(cmd_sort_info, int, num_of_cmds); - /* initialize it */ - for (a = 1; a < num_of_cmds; a++) { - cmd_sort_info[a].sort_pos = a; - cmd_sort_info[a].is_social = (cmd_info[a].command_pointer == do_action); - } - - /* the infernal special case */ - cmd_sort_info[find_command("insult")].is_social = TRUE; - - /* Sort. 'a' starts at 1, not 0, to remove 'RESERVED' */ - for (a = 1; a < num_of_cmds - 1; a++) - for (b = a + 1; b < num_of_cmds; b++) - if (strcmp(cmd_info[cmd_sort_info[a].sort_pos].command, - cmd_info[cmd_sort_info[b].sort_pos].command) > 0) { - tmp = cmd_sort_info[a].sort_pos; - cmd_sort_info[a].sort_pos = cmd_sort_info[b].sort_pos; - cmd_sort_info[b].sort_pos = tmp; - } -} + for (a = 0; a < num_of_cmds; a++) + cmd_sort_info[a] = a; + /* Don't sort the RESERVED or \n entries. */ + qsort(cmd_sort_info + 1, num_of_cmds - 2, sizeof(int), sort_commands_helper); +} ACMD(do_commands) @@ -1704,19 +1701,22 @@ vict == ch ? "you" : GET_NAME(vict)); /* cmd_num starts at 1, not 0, to remove 'RESERVED' */ - for (no = 1, cmd_num = 1; cmd_num < num_of_cmds; cmd_num++) { - i = cmd_sort_info[cmd_num].sort_pos; - if (cmd_info[i].minimum_level >= 0 && - GET_LEVEL(vict) >= cmd_info[i].minimum_level && - (cmd_info[i].minimum_level >= LVL_IMMORT) == wizhelp && - (wizhelp || socials == cmd_sort_info[i].is_social)) { - sprintf(buf + strlen(buf), "%-11s", cmd_info[i].command); - if (!(no % 7)) - strcat(buf, "\r\n"); - no++; - } + for (no = 1, cmd_num = 1; cmd_info[cmd_sort_info[cmd_num]].command[0] != '\n'; cmd_num++) { + i = cmd_sort_info[cmd_num]; + + if (cmd_info[i].minimum_level < 0 || GET_LEVEL(vict) < cmd_info[i].minimum_level) + continue; + + if ((cmd_info[i].minimum_level >= LVL_IMMORT) != wizhelp) + continue; + + if (!wizhelp && socials != (cmd_info[i].command_pointer == do_action || cmd_info[i].command_pointer == do_insult)) + continue; + + sprintf(buf + strlen(buf), "%-11s%s", cmd_info[i].command, no++ % 7 == 0 ? "\r\n" : ""); } - strcat(buf, "\r\n"); + if (no % 7 != 1) + strcat(buf, "\r\n"); send_to_char(buf, ch); } Index: circle/src/act.item.c diff -u circle/src/act.item.c:1.36 circle/src/act.item.c:1.42 --- circle/src/act.item.c:1.36 Thu Jan 25 16:50:43 2001 +++ circle/src/act.item.c Thu Jun 28 08:03:52 2001 @@ -27,29 +27,27 @@ extern room_rnum donation_room_2; /* uncomment if needed! */ extern room_rnum donation_room_3; /* uncomment if needed! */ #endif -extern struct obj_data *obj_proto; -extern struct room_data *world; /* local functions */ -int can_take_obj(struct char_data * ch, struct obj_data * obj); -void get_check_money(struct char_data * ch, struct obj_data * obj); -int perform_get_from_room(struct char_data * ch, struct obj_data * obj); -void get_from_room(struct char_data * ch, char *arg, int amount); -void perform_give_gold(struct char_data * ch, struct char_data * vict, int amount); -void perform_give(struct char_data * ch, struct char_data * vict, struct obj_data * obj); -int perform_drop(struct char_data * ch, struct obj_data * obj, byte mode, const char *sname, room_rnum RDR); -void perform_drop_gold(struct char_data * ch, int amount, byte mode, room_rnum RDR); -struct char_data *give_find_vict(struct char_data * ch, char *arg); -void weight_change_object(struct obj_data * obj, int weight); -void perform_put(struct char_data * ch, struct obj_data * obj, struct obj_data * cont); -void name_from_drinkcon(struct obj_data * obj); -void get_from_container(struct char_data * ch, struct obj_data * cont, char *arg, int mode, int amount); -void name_to_drinkcon(struct obj_data * obj, int type); -void wear_message(struct char_data * ch, struct obj_data * obj, int where); -void perform_wear(struct char_data * ch, struct obj_data * obj, int where); -int find_eq_pos(struct char_data * ch, struct obj_data * obj, char *arg); -void perform_get_from_container(struct char_data * ch, struct obj_data * obj, struct obj_data * cont, int mode); -void perform_remove(struct char_data * ch, int pos); +int can_take_obj(struct char_data *ch, struct obj_data *obj); +void get_check_money(struct char_data *ch, struct obj_data *obj); +int perform_get_from_room(struct char_data *ch, struct obj_data *obj); +void get_from_room(struct char_data *ch, char *arg, int amount); +void perform_give_gold(struct char_data *ch, struct char_data *vict, int amount); +void perform_give(struct char_data *ch, struct char_data *vict, struct obj_data *obj); +int perform_drop(struct char_data *ch, struct obj_data *obj, byte mode, const char *sname, room_rnum RDR); +void perform_drop_gold(struct char_data *ch, int amount, byte mode, room_rnum RDR); +struct char_data *give_find_vict(struct char_data *ch, char *arg); +void weight_change_object(struct obj_data *obj, int weight); +void perform_put(struct char_data *ch, struct obj_data *obj, struct obj_data *cont); +void name_from_drinkcon(struct obj_data *obj); +void get_from_container(struct char_data *ch, struct obj_data *cont, char *arg, int mode, int amount); +void name_to_drinkcon(struct obj_data *obj, int type); +void wear_message(struct char_data *ch, struct obj_data *obj, int where); +void perform_wear(struct char_data *ch, struct obj_data *obj, int where); +int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg); +void perform_get_from_container(struct char_data *ch, struct obj_data *obj, struct obj_data *cont, int mode); +void perform_remove(struct char_data *ch, int pos); ACMD(do_remove); ACMD(do_put); ACMD(do_get); @@ -63,8 +61,8 @@ ACMD(do_grab); -void perform_put(struct char_data * ch, struct obj_data * obj, - struct obj_data * cont) +void perform_put(struct char_data *ch, struct obj_data *obj, + struct obj_data *cont) { if (GET_OBJ_WEIGHT(cont) + GET_OBJ_WEIGHT(obj) > GET_OBJ_VAL(cont, 0)) act("$p won't fit in $P.", FALSE, ch, obj, cont, TO_CHAR); @@ -75,7 +73,7 @@ act("$n puts $p in $P.", TRUE, ch, obj, cont, TO_ROOM); /* Yes, I realize this is strange until we have auto-equip on rent. -gg */ - if (IS_OBJ_STAT(obj, ITEM_NODROP) && !IS_OBJ_STAT(cont, ITEM_NODROP)) { + if (OBJ_FLAGGED(obj, ITEM_NODROP) && !OBJ_FLAGGED(cont, ITEM_NODROP)) { SET_BIT(GET_OBJ_EXTRA(cont), ITEM_NODROP); act("You get a strange feeling as you put $p in $P.", FALSE, ch, obj, cont, TO_CHAR); @@ -144,7 +142,6 @@ } else if (obj == cont) send_to_char("You attempt to fold it into itself, but fail.\r\n", ch); else { - struct obj_data *next_obj; while(obj && howmany--) { next_obj = obj->next_content; perform_put(ch, obj, cont); @@ -175,7 +172,7 @@ -int can_take_obj(struct char_data * ch, struct obj_data * obj) +int can_take_obj(struct char_data *ch, struct obj_data *obj) { if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) { act("$p: you can't carry that many items.", FALSE, ch, obj, 0, TO_CHAR); @@ -191,7 +188,7 @@ } -void get_check_money(struct char_data * ch, struct obj_data * obj) +void get_check_money(struct char_data *ch, struct obj_data *obj) { int value = GET_OBJ_VAL(obj, 0); @@ -211,8 +208,8 @@ } -void perform_get_from_container(struct char_data * ch, struct obj_data * obj, - struct obj_data * cont, int mode) +void perform_get_from_container(struct char_data *ch, struct obj_data *obj, + struct obj_data *cont, int mode) { if (mode == FIND_OBJ_INV || can_take_obj(ch, obj)) { if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) @@ -228,7 +225,7 @@ } -void get_from_container(struct char_data * ch, struct obj_data * cont, +void get_from_container(struct char_data *ch, struct obj_data *cont, char *arg, int mode, int howmany) { struct obj_data *obj, *next_obj; @@ -275,7 +272,7 @@ } -int perform_get_from_room(struct char_data * ch, struct obj_data * obj) +int perform_get_from_room(struct char_data *ch, struct obj_data *obj) { if (can_take_obj(ch, obj)) { obj_from_room(obj); @@ -289,7 +286,7 @@ } -void get_from_room(struct char_data * ch, char *arg, int howmany) +void get_from_room(struct char_data *ch, char *arg, int howmany) { struct obj_data *obj, *next_obj; int dotmode, found = 0; @@ -347,9 +344,7 @@ argument = two_arguments(argument, arg1, arg2); one_argument(argument, arg3); - if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) - send_to_char("Your arms are already full!\r\n", ch); - else if (!*arg1) + if (!*arg1) send_to_char("Get what?\r\n", ch); else if (!*arg2) get_from_room(ch, arg1, 1); @@ -412,7 +407,7 @@ } -void perform_drop_gold(struct char_data * ch, int amount, +void perform_drop_gold(struct char_data *ch, int amount, byte mode, room_rnum RDR) { struct obj_data *obj; @@ -451,12 +446,12 @@ #define VANISH(mode) ((mode == SCMD_DONATE || mode == SCMD_JUNK) ? \ " It vanishes in a puff of smoke!" : "") -int perform_drop(struct char_data * ch, struct obj_data * obj, +int perform_drop(struct char_data *ch, struct obj_data *obj, byte mode, const char *sname, room_rnum RDR) { int value; - if (IS_OBJ_STAT(obj, ITEM_NODROP)) { + if (OBJ_FLAGGED(obj, ITEM_NODROP)) { sprintf(buf, "You can't %s $p, it must be CURSED!", sname); act(buf, FALSE, ch, obj, 0, TO_CHAR); return (0); @@ -467,7 +462,7 @@ act(buf, TRUE, ch, obj, 0, TO_ROOM); obj_from_char(obj); - if ((mode == SCMD_DONATE) && IS_OBJ_STAT(obj, ITEM_NODONATE)) + if ((mode == SCMD_DONATE) && OBJ_FLAGGED(obj, ITEM_NODONATE)) mode = SCMD_JUNK; switch (mode) { @@ -607,10 +602,10 @@ } -void perform_give(struct char_data * ch, struct char_data * vict, - struct obj_data * obj) +void perform_give(struct char_data *ch, struct char_data *vict, + struct obj_data *obj) { - if (IS_OBJ_STAT(obj, ITEM_NODROP)) { + if (OBJ_FLAGGED(obj, ITEM_NODROP)) { act("You can't let go of $p!! Yeech!", FALSE, ch, obj, 0, TO_CHAR); return; } @@ -630,7 +625,7 @@ } /* utility function for give */ -struct char_data *give_find_vict(struct char_data * ch, char *arg) +struct char_data *give_find_vict(struct char_data *ch, char *arg) { struct char_data *vict; @@ -648,7 +643,7 @@ } -void perform_give_gold(struct char_data * ch, struct char_data * vict, +void perform_give_gold(struct char_data *ch, struct char_data *vict, int amount) { if (amount <= 0) { @@ -734,7 +729,7 @@ -void weight_change_object(struct obj_data * obj, int weight) +void weight_change_object(struct obj_data *obj, int weight) { struct obj_data *tmp_obj; struct char_data *tmp_ch; @@ -756,7 +751,7 @@ -void name_from_drinkcon(struct obj_data * obj) +void name_from_drinkcon(struct obj_data *obj) { char *new_name, *cur_name, *next; const char *liqname; @@ -1134,7 +1129,7 @@ -void wear_message(struct char_data * ch, struct obj_data * obj, int where) +void wear_message(struct char_data *ch, struct obj_data *obj, int where) { const char *wear_messages[][2] = { {"$n lights $p and holds it.", @@ -1198,7 +1193,7 @@ -void perform_wear(struct char_data * ch, struct obj_data * obj, int where) +void perform_wear(struct char_data *ch, struct obj_data *obj, int where) { /* * ITEM_WEAR_TAKE is used for objects that do not require special bits @@ -1256,7 +1251,7 @@ -int find_eq_pos(struct char_data * ch, struct obj_data * obj, char *arg) +int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg) { int where = -1; @@ -1418,13 +1413,13 @@ -void perform_remove(struct char_data * ch, int pos) +void perform_remove(struct char_data *ch, int pos) { struct obj_data *obj; if (!(obj = GET_EQ(ch, pos))) log("SYSERR: perform_remove: bad pos %d passed.", pos); - else if (IS_OBJ_STAT(obj, ITEM_NODROP)) + else if (OBJ_FLAGGED(obj, ITEM_NODROP)) act("You can't remove $p, it must be CURSED!", FALSE, ch, obj, 0, TO_CHAR); else if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) act("$p: you can't carry that many items!", FALSE, ch, obj, 0, TO_CHAR); @@ -1475,8 +1470,7 @@ } } } else { - /* Returns object pointer but we don't need it, just true/false. */ - if (!get_object_in_equip_vis(ch, arg, ch->equipment, &i)) { + if ((i = get_obj_pos_in_equip_vis(ch, arg, NULL, ch->equipment)) < 0) { sprintf(buf, "You don't seem to be using %s %s.\r\n", AN(arg), arg); send_to_char(buf, ch); } else Index: circle/src/act.movement.c diff -u circle/src/act.movement.c:1.21 circle/src/act.movement.c:1.25 --- circle/src/act.movement.c:1.21 Thu Jan 25 16:50:43 2001 +++ circle/src/act.movement.c Thu Jun 28 08:03:52 2001 @@ -22,17 +22,15 @@ #include "house.h" #include "constants.h" -/* external vars */ -extern struct room_data *world; -extern struct char_data *character_list; -extern struct descriptor_data *descriptor_list; -extern struct index_data *obj_index; -/* external functs */ +/* external variables */ +extern int tunnel_size; + +/* external functions */ void add_follower(struct char_data *ch, struct char_data *leader); int special(struct char_data *ch, int cmd, char *arg); void death_cry(struct char_data *ch); -int find_eq_pos(struct char_data * ch, struct obj_data * obj, char *arg); +int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg); /* local functions */ int has_boat(struct char_data *ch); @@ -137,8 +135,11 @@ } } if (ROOM_FLAGGED(EXIT(ch, dir)->to_room, ROOM_TUNNEL) && - num_pc_in_room(&(world[EXIT(ch, dir)->to_room])) > 1) { - send_to_char("There isn't enough room there for more than one person!\r\n", ch); + num_pc_in_room(&(world[EXIT(ch, dir)->to_room])) >= tunnel_size) { + if (tunnel_size > 1) + send_to_char("There isn't enough room for you to go there!\r\n", ch); + else + send_to_char("There isn't enough room there for more than one person!\r\n", ch); return (0); } /* Mortals and low level gods cannot enter greater god rooms. */ Index: circle/src/act.offensive.c diff -u circle/src/act.offensive.c:1.24 circle/src/act.offensive.c:1.27 --- circle/src/act.offensive.c:1.24 Sun Mar 18 18:58:58 2001 +++ circle/src/act.offensive.c Thu Jun 28 08:03:52 2001 @@ -21,13 +21,11 @@ #include "spells.h" /* extern variables */ -extern struct room_data *world; -extern struct descriptor_data *descriptor_list; extern int pk_allowed; /* extern functions */ -void raw_kill(struct char_data * ch); -void check_killer(struct char_data * ch, struct char_data * vict); +void raw_kill(struct char_data *ch); +void check_killer(struct char_data *ch, struct char_data *vict); int compute_armor_class(struct char_data *ch); /* local functions */ @@ -211,7 +209,6 @@ { char name[MAX_INPUT_LENGTH], message[MAX_INPUT_LENGTH]; bool found = FALSE; - room_rnum org_room; struct char_data *vict; struct follow_type *k; @@ -243,10 +240,8 @@ sprintf(buf, "$n issues the order '%s'.", message); act(buf, FALSE, ch, 0, 0, TO_ROOM); - org_room = ch->in_room; - for (k = ch->followers; k; k = k->next) { - if (org_room == k->follower->in_room) + if (IN_ROOM(ch) == IN_ROOM(k->follower)) if (AFF_FLAGGED(k->follower, AFF_CHARM)) { found = TRUE; command_interpreter(k->follower, message); Index: circle/src/act.other.c diff -u circle/src/act.other.c:1.33 circle/src/act.other.c:1.35 --- circle/src/act.other.c:1.33 Thu Jan 25 18:01:22 2001 +++ circle/src/act.other.c Thu Jun 28 08:03:52 2001 @@ -25,11 +25,8 @@ #include "constants.h" /* extern variables */ -extern struct room_data *world; -extern struct descriptor_data *descriptor_list; extern struct spell_info_type spell_info[]; -extern struct index_data *mob_index; -extern char *class_abbrevs[]; +extern const char *class_abbrevs[]; extern int free_rent; extern int pt_allowed; extern int max_filesize; @@ -38,14 +35,14 @@ extern int track_through_doors; /* extern procedures */ -void list_skills(struct char_data * ch); -void appear(struct char_data * ch); +void list_skills(struct char_data *ch); +void appear(struct char_data *ch); void write_aliases(struct char_data *ch); void perform_immort_vis(struct char_data *ch); SPECIAL(shop_keeper); ACMD(do_gen_comm); -void die(struct char_data * ch); -void Crash_rentsave(struct char_data * ch, int cost); +void die(struct char_data *ch); +void Crash_rentsave(struct char_data *ch, int cost); /* local functions */ ACMD(do_quit); Index: circle/src/act.social.c diff -u circle/src/act.social.c:1.16 circle/src/act.social.c:1.18 --- circle/src/act.social.c:1.16 Thu Jan 25 16:50:43 2001 +++ circle/src/act.social.c Thu Jun 28 08:03:52 2001 @@ -20,15 +20,12 @@ #include "db.h" #include "spells.h" -/* extern variables */ -extern struct room_data *world; -extern struct descriptor_data *descriptor_list; /* local globals */ static int list_top = -1; /* local functions */ -char *fread_action(FILE * fl, int nr); +char *fread_action(FILE *fl, int nr); int find_action(int cmd); ACMD(do_action); ACMD(do_insult); @@ -178,7 +175,7 @@ } -char *fread_action(FILE * fl, int nr) +char *fread_action(FILE *fl, int nr) { char buf[MAX_STRING_LENGTH]; Index: circle/src/act.wizard.c diff -u circle/src/act.wizard.c:1.44 circle/src/act.wizard.c:1.52 --- circle/src/act.wizard.c:1.44 Mon Mar 5 04:44:48 2001 +++ circle/src/act.wizard.c Fri Jun 29 06:21:38 2001 @@ -24,13 +24,6 @@ /* external vars */ extern FILE *player_fl; -extern struct room_data *world; -extern struct char_data *character_list; -extern struct obj_data *object_list; -extern struct descriptor_data *descriptor_list; -extern struct index_data *mob_index; -extern struct index_data *obj_index; -extern struct zone_data *zone_table; extern struct attack_hit_type attack_hit_text[]; extern char *class_abbrevs[]; extern time_t boot_time; @@ -48,7 +41,7 @@ /* extern functions */ int level_exp(int chclass, int level); -void show_shops(struct char_data * ch, char *value); +void show_shops(struct char_data *ch, char *value); void hcontrol_list_houses(struct char_data *ch); void do_start(struct char_data *ch); void appear(struct char_data *ch); @@ -61,18 +54,18 @@ void perform_immort_invis(struct char_data *ch, int level); ACMD(do_echo); ACMD(do_send); -room_rnum find_target_room(struct char_data * ch, char *rawroomstr); +room_rnum find_target_room(struct char_data *ch, char *rawroomstr); ACMD(do_at); ACMD(do_goto); ACMD(do_trans); ACMD(do_teleport); ACMD(do_vnum); -void do_stat_room(struct char_data * ch); -void do_stat_object(struct char_data * ch, struct obj_data * j); -void do_stat_character(struct char_data * ch, struct char_data * k); +void do_stat_room(struct char_data *ch); +void do_stat_object(struct char_data *ch, struct obj_data *j); +void do_stat_character(struct char_data *ch, struct char_data *k); ACMD(do_stat); ACMD(do_shutdown); -void stop_snooping(struct char_data * ch); +void stop_snooping(struct char_data *ch); ACMD(do_snoop); ACMD(do_switch); ACMD(do_return); @@ -146,7 +139,7 @@ /* take a string, and return an rnum.. used for goto, at, etc. -je 4/6/93 */ -room_rnum find_target_room(struct char_data * ch, char *rawroomstr) +room_rnum find_target_room(struct char_data *ch, char *rawroomstr) { room_rnum location = NOWHERE; char roomstr[MAX_INPUT_LENGTH]; @@ -371,7 +364,7 @@ -void do_stat_room(struct char_data * ch) +void do_stat_room(struct char_data *ch) { struct extra_descr_data *desc; struct room_data *rm = &world[ch->in_room]; @@ -473,7 +466,7 @@ -void do_stat_object(struct char_data * ch, struct obj_data * j) +void do_stat_object(struct char_data *ch, struct obj_data *j) { int i, found; obj_vnum vnum; @@ -647,7 +640,7 @@ } -void do_stat_character(struct char_data * ch, struct char_data * k) +void do_stat_character(struct char_data *ch, struct char_data *k) { int i, i2, found = 0; struct obj_data *j; @@ -842,7 +835,6 @@ struct char_data *victim; struct obj_data *object; struct char_file_u tmp_store; - int tmp; half_chop(argument, buf1, buf2); @@ -870,12 +862,14 @@ send_to_char("No such player around.\r\n", ch); } } else if (is_abbrev(buf1, "file")) { - if (!*buf2) { + if (!*buf2) send_to_char("Stats on which player?\r\n", ch); - } else { + else if ((victim = get_player_vis(ch, buf2, NULL, FIND_CHAR_WORLD)) != NULL) + do_stat_character(ch, victim); + else { CREATE(victim, struct char_data, 1); clear_char(victim); - if (load_char(buf2, &tmp_store) > -1) { + if (load_char(buf2, &tmp_store) >= 0) { store_to_char(&tmp_store, victim); victim->player.time.logon = tmp_store.last_logon; char_to_room(victim, 0); @@ -883,7 +877,7 @@ send_to_char("Sorry, you can't do that.\r\n", ch); else do_stat_character(ch, victim); - extract_char(victim); + extract_char_final(victim); } else { send_to_char("There is no such player.\r\n", ch); free(victim); @@ -902,7 +896,7 @@ char *name = buf1; int number = get_number(&name); - if ((object = get_object_in_equip_vis(ch, buf1, ch->equipment, &tmp)) != NULL) + if ((object = get_obj_in_equip_vis(ch, buf1, &number, ch->equipment)) != NULL) do_stat_object(ch, object); else if ((object = get_obj_in_list_vis(ch, buf1, &number, ch->carrying)) != NULL) do_stat_object(ch, object); @@ -951,8 +945,28 @@ send_to_char("Unknown shutdown option.\r\n", ch); } + +void snoop_check(struct char_data *ch) +{ + /* This short routine is to ensure that characters that happen + * to be snooping (or snooped) and get advanced/demoted will + * not be snooping/snooped someone of a higher/lower level (and + * thus, not entitled to be snooping. + */ + if (ch->desc->snooping && + (GET_LEVEL(ch->desc->snooping->character) >= GET_LEVEL(ch))) { + ch->desc->snooping->snoop_by = NULL; + ch->desc->snooping = NULL; + } + + if (ch->desc->snoop_by && + (GET_LEVEL(ch) >= GET_LEVEL(ch->desc->snoop_by->character))) { + ch->desc->snoop_by->snooping = NULL; + ch->desc->snoop_by = NULL; + } +} -void stop_snooping(struct char_data * ch) +void stop_snooping(struct char_data *ch) { if (!ch->desc->snooping) send_to_char("You aren't snooping anyone.\r\n", ch); @@ -1321,13 +1335,19 @@ log("(GC) %s has advanced %s to level %d (from %d)", GET_NAME(ch), GET_NAME(victim), newlevel, oldlevel); + if (newlevel < LVL_IMMORT) { + /* If they are no longer an immortal, let's remove some of the + * nice immortal only flags, shall we? + */ + REMOVE_BIT(PRF_FLAGS(ch), PRF_LOG1 | PRF_LOG2); + REMOVE_BIT(PRF_FLAGS(ch), PRF_NOHASSLE | PRF_HOLYLIGHT); + } + gain_exp_regardless(victim, level_exp(GET_CLASS(victim), newlevel) - GET_EXP(victim)); save_char(victim, NOWHERE); } - - ACMD(do_restore) { struct char_data *vict; @@ -1827,7 +1847,6 @@ /* * General fn for wizcommands of the sort: cmd */ - ACMD(do_wizutil) { struct char_data *vict; @@ -1942,10 +1961,11 @@ void print_zone_to_buf(char *bufptr, zone_rnum zone) { - sprintf(bufptr, "%s%3d %-30.30s Age: %3d; Reset: %3d (%1d); Top: %5d\r\n", + sprintf(bufptr, "%s%3d %-30.30s Age: %3d; Reset: %3d (%1d); Range: %5d-%5d\r\n", bufptr, zone_table[zone].number, zone_table[zone].name, zone_table[zone].age, zone_table[zone].lifespan, - zone_table[zone].reset_mode, zone_table[zone].top); + zone_table[zone].reset_mode, + zone_table[zone].bot, zone_table[zone].top); } Index: circle/src/ban.c diff -u circle/src/ban.c:1.10 circle/src/ban.c:1.13 --- circle/src/ban.c:1.10 Sat Oct 10 15:04:19 1998 +++ circle/src/ban.c Sat Jun 30 23:56:52 2001 @@ -19,13 +19,13 @@ #include "handler.h" #include "db.h" +/* local globals */ struct ban_list_element *ban_list = NULL; -extern struct descriptor_data *descriptor_list; /* local functions */ void load_banned(void); int isbanned(char *hostname); -void _write_one_node(FILE * fp, struct ban_list_element * node); +void _write_one_node(FILE *fp, struct ban_list_element *node); void write_ban_list(void); ACMD(do_ban); ACMD(do_unban); @@ -99,7 +99,7 @@ } -void _write_one_node(FILE * fp, struct ban_list_element * node) +void _write_one_node(FILE *fp, struct ban_list_element *node) { if (node) { _write_one_node(fp, node->next); @@ -124,10 +124,10 @@ } +#define BAN_LIST_FORMAT "%-25.25s %-8.8s %-10.10s %-16.16s\r\n" ACMD(do_ban) { - char flag[MAX_INPUT_LENGTH], site[MAX_INPUT_LENGTH], - format[MAX_INPUT_LENGTH], *nextchar, *timestr; + char flag[MAX_INPUT_LENGTH], site[MAX_INPUT_LENGTH], *nextchar, *timestr; int i; struct ban_list_element *ban_node; @@ -138,14 +138,13 @@ send_to_char("No sites are banned.\r\n", ch); return; } - strcpy(format, "%-25.25s %-8.8s %-10.10s %-16.16s\r\n"); - sprintf(buf, format, + sprintf(buf, BAN_LIST_FORMAT, "Banned Site Name", "Ban Type", "Banned On", "Banned By"); send_to_char(buf, ch); - sprintf(buf, format, + sprintf(buf, BAN_LIST_FORMAT, "---------------------------------", "---------------------------------", "---------------------------------", @@ -159,8 +158,9 @@ strcpy(site, timestr); } else strcpy(site, "Unknown"); - sprintf(buf, format, ban_node->site, ban_types[ban_node->type], site, - ban_node->name); + + sprintf(buf, BAN_LIST_FORMAT, ban_node->site, ban_types[ban_node->type], + site, ban_node->name); send_to_char(buf, ch); } return; @@ -203,6 +203,7 @@ send_to_char("Site banned.\r\n", ch); write_ban_list(); } +#undef BAN_LIST_FORMAT ACMD(do_unban) Index: circle/src/boards.c diff -u circle/src/boards.c:1.18 circle/src/boards.c:1.21 --- circle/src/boards.c:1.18 Wed Mar 7 01:39:51 2001 +++ circle/src/boards.c Thu Jun 28 08:03:52 2001 @@ -59,9 +59,6 @@ /* Board appearance order. */ #define NEWEST_AT_TOP FALSE -extern struct room_data *world; -extern struct descriptor_data *descriptor_list; - /* format: vnum, read lvl, write lvl, remove lvl, filename, 0 at end Be sure to also change NUM_OF_BOARDS in board.h @@ -76,7 +73,7 @@ /* local functions */ SPECIAL(gen_board); int find_slot(void); -int find_board(struct char_data * ch); +int find_board(struct char_data *ch); void init_boards(void); char *msg_storage[INDEX_SIZE]; @@ -100,7 +97,7 @@ /* search the room ch is standing in to find which board he's looking at */ -int find_board(struct char_data * ch) +int find_board(struct char_data *ch) { struct obj_data *obj; int i; @@ -182,7 +179,7 @@ } -int Board_write_message(int board_type, struct char_data * ch, char *arg, struct obj_data *board) +int Board_write_message(int board_type, struct char_data *ch, char *arg, struct obj_data *board) { char *tmstr; time_t ct; @@ -232,7 +229,7 @@ } -int Board_show_board(int board_type, struct char_data * ch, char *arg, struct obj_data *board) +int Board_show_board(int board_type, struct char_data *ch, char *arg, struct obj_data *board) { int i; char tmp[MAX_STRING_LENGTH], buf[MAX_STRING_LENGTH]; @@ -285,7 +282,7 @@ } -int Board_display_msg(int board_type, struct char_data * ch, char *arg, struct obj_data *board) +int Board_display_msg(int board_type, struct char_data *ch, char *arg, struct obj_data *board) { char number[MAX_STRING_LENGTH], buffer[MAX_STRING_LENGTH]; int msg, ind; @@ -295,9 +292,9 @@ return (0); if (isname(number, board->name)) /* so "read board" works */ return (Board_show_board(board_type, ch, arg, board)); - if (strchr(number, '.')) /* read 2.mail, look 2.sword */ + if (!is_number(number)) /* read 2.mail, look 2.sword */ return (0); - if (!isdigit(*number) || (!(msg = atoi(number)))) + if (!(msg = atoi(number))) return (0); if (GET_LEVEL(ch) < READ_LVL(board_type)) { @@ -342,7 +339,7 @@ } -int Board_remove_msg(int board_type, struct char_data * ch, char *arg, struct obj_data *board) +int Board_remove_msg(int board_type, struct char_data *ch, char *arg, struct obj_data *board) { int ind, msg, slot_num; char number[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH]; @@ -350,7 +347,7 @@ one_argument(arg, number); - if (!*number || !isdigit(*number)) + if (!*number || !is_number(number)) return (0); if (!(msg = atoi(number))) return (0); Index: circle/src/castle.c diff -u circle/src/castle.c:1.17 circle/src/castle.c:1.20 --- circle/src/castle.c:1.17 Sun Jul 4 20:55:37 1999 +++ circle/src/castle.c Thu Jun 28 08:03:52 2001 @@ -22,15 +22,6 @@ #include "spells.h" -/* external vars */ -extern struct room_data *world; -extern struct char_data *character_list; -extern struct descriptor_data *descriptor_list; -extern struct index_data *mob_index; -extern struct index_data *obj_index; -extern struct time_info_data time_info; -extern int mini_mud; - /* IMPORTANT! The below defined number is the zone number of the Kings Castle. Change it to apply to your chosen zone number. The default zone @@ -38,20 +29,28 @@ in the 8000 series... */ #define Z_KINGS_C 150 + + +/* external variables */ +extern struct time_info_data time_info; +extern int mini_mud; + /* local functions */ -struct char_data *find_npc_by_name(struct char_data * chAtChar, const char *pszName, int iLen); -int block_way(struct char_data * ch, int cmd, char *arg, room_rnum iIn_room, int iProhibited_direction); +mob_vnum castle_virtual(mob_vnum offset); +room_rnum castle_real_room(room_vnum roomoffset); +struct char_data *find_npc_by_name(struct char_data *chAtChar, const char *pszName, int iLen); +int block_way(struct char_data *ch, int cmd, char *arg, room_rnum iIn_room, int iProhibited_direction); void assign_kings_castle(void); -int member_of_staff(struct char_data * chChar); -int member_of_royal_guard(struct char_data * chChar); -struct char_data *find_guard(struct char_data * chAtChar); -struct char_data *get_victim(struct char_data * chAtChar); -int banzaii(struct char_data * ch); -int do_npc_rescue(struct char_data * ch_hero, struct char_data * ch_victim); -int is_trash(struct obj_data * i); -void fry_victim(struct char_data * ch); +int member_of_staff(struct char_data *chChar); +int member_of_royal_guard(struct char_data *chChar); +struct char_data *find_guard(struct char_data *chAtChar); +struct char_data *get_victim(struct char_data *chAtChar); +int banzaii(struct char_data *ch); +int do_npc_rescue(struct char_data *ch_hero, struct char_data *ch_victim); +int is_trash(struct obj_data *i); +void fry_victim(struct char_data *ch); int castle_cleaner(struct char_data *ch, int cmd, int gripe); -int castle_twin_proc(struct char_data *ch, int cmd, char *arg, int ctlnum, char *twinname); +int castle_twin_proc(struct char_data *ch, int cmd, char *arg, int ctlnum, const char *twinname); /**********************************************************************\ @@ -64,18 +63,12 @@ * the King's Castle does not exist. (Writing to mob_index[-1].func) */ #define C_MOB_SPEC(zone,mob) \ - if ((check = real_mobile(((zone)*100)+(mob))) < 0) { \ + if ((check = real_mobile(castle_virtual(mob))) < 0) { \ if (!mini_mud) \ - log("SYSERR: assign_kings_castle(): can't find mob #%d.", ((zone)*100)+(mob)); \ + log("SYSERR: assign_kings_castle(): can't find mob #%d.", castle_virtual(mob)); \ } else \ mob_index[check].func -#define R_MOB(zone, mob) (real_mobile(((zone)*100)+(mob))) -#define R_OBJ(zone, obj) (real_object(((zone)*100)+(obj))) -#define R_ROOM(zone, num) (real_room(((zone)*100)+(num))) - -#define CASTLE_ITEM(item) (Z_KINGS_C*100+(item)) - SPECIAL(CastleGuard); SPECIAL(James); SPECIAL(cleaning); @@ -90,6 +83,25 @@ ACMD(do_gen_door); ACMD(do_follow); +mob_vnum castle_virtual(mob_vnum offset) +{ + zone_rnum zon; + + if ((zon = real_zone(Z_KINGS_C)) == NOWHERE) + return NOWHERE; + + return zone_table[zon].bot + offset; +} + +room_rnum castle_real_room(room_vnum roomoffset) +{ + zone_rnum zon; + + if ((zon = real_zone(Z_KINGS_C)) == NOWHERE) + return NOWHERE; + + return real_room(zone_table[zon].bot + roomoffset); +} /* * Routine: assign_kings_castle @@ -135,7 +147,7 @@ * Used to see if a character is a member of the castle staff. * Used mainly by BANZAI:ng NPC:s. */ -int member_of_staff(struct char_data * chChar) +int member_of_staff(struct char_data *chChar) { int ch_num; @@ -144,16 +156,16 @@ ch_num = GET_MOB_VNUM(chChar); - if (ch_num == CASTLE_ITEM(1)) + if (ch_num == castle_virtual(1)) return (TRUE); - if (ch_num > CASTLE_ITEM(2) && ch_num < CASTLE_ITEM(15)) + if (ch_num > castle_virtual(2) && ch_num < castle_virtual(15)) return (TRUE); - if (ch_num > CASTLE_ITEM(15) && ch_num < CASTLE_ITEM(18)) + if (ch_num > castle_virtual(15) && ch_num < castle_virtual(18)) return (TRUE); - if (ch_num > CASTLE_ITEM(18) && ch_num < CASTLE_ITEM(30)) + if (ch_num > castle_virtual(18) && ch_num < castle_virtual(30)) return (TRUE); return (FALSE); @@ -166,7 +178,7 @@ * Returns TRUE if the character is a guard on duty, otherwise FALSE. * Used by Peter the captain of the royal guard. */ -int member_of_royal_guard(struct char_data * chChar) +int member_of_royal_guard(struct char_data *chChar) { int ch_num; @@ -175,13 +187,13 @@ ch_num = GET_MOB_VNUM(chChar); - if (ch_num == CASTLE_ITEM(3) || ch_num == CASTLE_ITEM(6)) + if (ch_num == castle_virtual(3) || ch_num == castle_virtual(6)) return (TRUE); - if (ch_num > CASTLE_ITEM(7) && ch_num < CASTLE_ITEM(12)) + if (ch_num > castle_virtual(7) && ch_num < castle_virtual(12)) return (TRUE); - if (ch_num > CASTLE_ITEM(23) && ch_num < CASTLE_ITEM(26)) + if (ch_num > castle_virtual(23) && ch_num < castle_virtual(26)) return (TRUE); return (FALSE); @@ -194,7 +206,7 @@ * Returns a pointer to an npc by the given name. * Used by Tim and Tom */ -struct char_data *find_npc_by_name(struct char_data * chAtChar, +struct char_data *find_npc_by_name(struct char_data *chAtChar, const char *pszName, int iLen) { struct char_data *ch; @@ -213,7 +225,7 @@ * Returns the pointer to a guard on duty. * Used by Peter the Captain of the Royal Guard */ -struct char_data *find_guard(struct char_data * chAtChar) +struct char_data *find_guard(struct char_data *chAtChar) { struct char_data *ch; @@ -232,7 +244,7 @@ * fighting someone in the castle staff... * Used by BANZAII-ing characters and King Welmar... */ -struct char_data *get_victim(struct char_data * chAtChar) +struct char_data *get_victim(struct char_data *chAtChar) { struct char_data *ch; int iNum_bad_guys = 0, iVictim; @@ -273,7 +285,7 @@ * Makes a character banzaii on attackers of the castle staff. * Used by Guards, Tim, Tom, Dick, David, Peter, Master, King and Guards. */ -int banzaii(struct char_data * ch) +int banzaii(struct char_data *ch) { struct char_data *chOpponent; @@ -293,7 +305,7 @@ * Makes ch_hero rescue ch_victim. * Used by Tim and Tom */ -int do_npc_rescue(struct char_data * ch_hero, struct char_data * ch_victim) +int do_npc_rescue(struct char_data *ch_hero, struct char_data *ch_victim) { struct char_data *ch_bad_guy; @@ -325,7 +337,7 @@ * Procedure to block a person trying to enter a room. * Used by Tim/Tom at Kings bedroom and Dick/David at treasury. */ -int block_way(struct char_data * ch, int cmd, char *arg, room_rnum iIn_room, +int block_way(struct char_data *ch, int cmd, char *arg, room_rnum iIn_room, int iProhibited_direction) { if (cmd != ++iProhibited_direction) @@ -349,7 +361,7 @@ * Routine to check if an object is trash... * Used by James the Butler and the Cleaning Lady. */ -int is_trash(struct obj_data * i) +int is_trash(struct obj_data *i) { if (!OBJWEAR_FLAGGED(i, ITEM_WEAR_TAKE)) return (FALSE); @@ -367,7 +379,7 @@ * Finds a suitabe victim, and cast some _NASTY_ spell on him. * Used by King Welmar */ -void fry_victim(struct char_data * ch) +void fry_victim(struct char_data *ch) { struct char_data *tch; @@ -435,15 +447,15 @@ static bool move = FALSE; if (!move) { - if (time_info.hours == 8 && ch->in_room == R_ROOM(Z_KINGS_C, 51)) { + if (time_info.hours == 8 && ch->in_room == castle_real_room(51)) { move = TRUE; path = throne_path; index = 0; - } else if (time_info.hours == 21 && ch->in_room == R_ROOM(Z_KINGS_C, 17)) { + } else if (time_info.hours == 21 && ch->in_room == castle_real_room(17)) { move = TRUE; path = bedroom_path; index = 0; - } else if (time_info.hours == 12 && ch->in_room == R_ROOM(Z_KINGS_C, 17)) { + } else if (time_info.hours == 12 && ch->in_room == castle_real_room(17)) { move = TRUE; path = monolog_path; index = 0; @@ -636,7 +648,7 @@ /* * Common routine for the Castle Twins. */ -int castle_twin_proc(struct char_data *ch, int cmd, char *arg, int ctlnum, char *twinname) +int castle_twin_proc(struct char_data *ch, int cmd, char *arg, int ctlnum, const char *twinname) { struct char_data *king, *twin; @@ -644,7 +656,7 @@ return (FALSE); if (cmd) - return block_way(ch, cmd, arg, CASTLE_ITEM(ctlnum), 1); + return block_way(ch, cmd, arg, castle_virtual(ctlnum), 1); if ((king = find_npc_by_name(ch, "King Welmar", 11)) != NULL) { if (!ch->master) @@ -740,7 +752,7 @@ if (!cmd && GET_POS(ch) != POS_FIGHTING) banzaii(ch); - return (block_way(ch, cmd, arg, CASTLE_ITEM(36), 1)); + return (block_way(ch, cmd, arg, castle_virtual(36), 1)); } Index: circle/src/class.c diff -u circle/src/class.c:1.19 circle/src/class.c:1.24 --- circle/src/class.c:1.19 Sun Mar 18 05:15:42 2001 +++ circle/src/class.c Thu Jun 28 08:03:52 2001 @@ -30,12 +30,13 @@ extern int siteok_everyone; /* local functions */ +void snoop_check(struct char_data *ch); int parse_class(char arg); long find_class_bitvector(char arg); byte saving_throws(int class_num, int type, int level); int thaco(int class_num, int level); -void roll_real_abils(struct char_data * ch); -void do_start(struct char_data * ch); +void roll_real_abils(struct char_data *ch); +void do_start(struct char_data *ch); int backstab_mult(int level); int invalid_class(struct char_data *ch, struct obj_data *obj); int level_exp(int chclass, int level); @@ -146,10 +147,10 @@ int prac_params[4][NUM_CLASSES] = { /* MAG CLE THE WAR */ - {95, 95, 85, 80}, /* learned level */ - {100, 100, 12, 12}, /* max per prac */ - {25, 25, 0, 0,}, /* min per pac */ - {SPELL, SPELL, SKILL, SKILL} /* prac name */ + { 95, 95, 85, 80 }, /* learned level */ + { 100, 100, 12, 12 }, /* max per practice */ + { 25, 25, 0, 0 }, /* min per practice */ + { SPELL, SPELL, SKILL, SKILL }, /* prac name */ }; @@ -1397,7 +1398,7 @@ * the best 3 out of 4 rolls of a 6-sided die. Each class then decides * which priority will be given for the best to worst stats. */ -void roll_real_abils(struct char_data * ch) +void roll_real_abils(struct char_data *ch) { int i, j, k, temp; ubyte table[6]; @@ -1465,7 +1466,7 @@ /* Some initializations for characters, including initial skills */ -void do_start(struct char_data * ch) +void do_start(struct char_data *ch) { GET_LEVEL(ch) = 1; GET_EXP(ch) = 1; @@ -1520,7 +1521,7 @@ * This function controls the change to maxmove, maxmana, and maxhp for * each class every time they gain a level. */ -void advance_level(struct char_data * ch) +void advance_level(struct char_data *ch) { int add_hp, add_mana = 0, add_move = 0, i; @@ -1572,6 +1573,7 @@ SET_BIT(PRF_FLAGS(ch), PRF_HOLYLIGHT); } + snoop_check(ch); save_char(ch, NOWHERE); } @@ -1607,22 +1609,20 @@ */ int invalid_class(struct char_data *ch, struct obj_data *obj) { - if (IS_OBJ_STAT(obj, ITEM_ANTI_MAGIC_USER) && IS_MAGIC_USER(ch)) - return 1; + if (OBJ_FLAGGED(obj, ITEM_ANTI_MAGIC_USER) && IS_MAGIC_USER(ch)) + return TRUE; - if (IS_OBJ_STAT(obj, ITEM_ANTI_CLERIC) && IS_CLERIC(ch)) - return 1; + if (OBJ_FLAGGED(obj, ITEM_ANTI_CLERIC) && IS_CLERIC(ch)) + return TRUE; - if (IS_OBJ_STAT(obj, ITEM_ANTI_WARRIOR) && IS_WARRIOR(ch)) - return 1; + if (OBJ_FLAGGED(obj, ITEM_ANTI_WARRIOR) && IS_WARRIOR(ch)) + return TRUE; - if (IS_OBJ_STAT(obj, ITEM_ANTI_THIEF) && IS_THIEF(ch)) - return 1; + if (OBJ_FLAGGED(obj, ITEM_ANTI_THIEF) && IS_THIEF(ch)) + return TRUE; - return 0; + return FALSE; } - - /* Index: circle/src/comm.c diff -u circle/src/comm.c:1.88 circle/src/comm.c:1.97 --- circle/src/comm.c:1.88 Sun Mar 18 18:58:58 2001 +++ circle/src/comm.c Thu Aug 2 21:09:49 2001 @@ -84,7 +84,6 @@ extern int auto_save; /* see config.c */ extern int autosave_time; /* see config.c */ -extern struct room_data *world; /* In db.c */ extern struct time_info_data time_info; /* In db.c */ extern char *help; @@ -101,6 +100,8 @@ int tics = 0; /* for extern checkpointing */ int scheck = 0; /* for syntax checking mode */ struct timeval null_time; /* zero-valued time structure */ +byte reread_wizlist; /* signal: SIGUSR1 */ +byte emergency_unban; /* signal: SIGUSR2 */ FILE *logfile = NULL; /* Where to send the log messages. */ /* functions in this file */ @@ -140,7 +141,7 @@ void setup_log(const char *filename, int fd); int open_logfile(const char *filename, FILE *stderr_fp); #if defined(POSIX) -sigfunc *my_signal(int signo, sigfunc * func); +sigfunc *my_signal(int signo, sigfunc *func); #endif /* extern fcnts */ @@ -301,7 +302,7 @@ * Moved here to distinguish command line options and to show up * in the log if stderr is redirected to a file. */ - log(circlemud_version); + log("%s", circlemud_version); if (chdir(dir) < 0) { perror("SYSERR: Fatal error changing to data directory"); @@ -361,6 +362,9 @@ CLOSE_SOCKET(mother_desc); fclose(player_fl); + log("Saving current MUD time."); + save_mud_time(&time_info); + if (circle_reboot) { log("Rebooting."); exit(52); /* what's so great about HHGTTG, anyhow? */ @@ -776,6 +780,20 @@ while (missed_pulses--) heartbeat(++pulse); + /* Check for any signals we may have received. */ + if (reread_wizlist) { + reread_wizlist = FALSE; + mudlog("Signal received - rereading wizlists.", CMP, LVL_IMMORT, TRUE); + reboot_wizlists(); + } + if (emergency_unban) { + emergency_unban = FALSE; + mudlog("Received SIGUSR2 - completely unrestricting game (emergent)", BRF, LVL_IMMORT, TRUE); + ban_list = NULL; + circle_restrict = 0; + num_invalid = 0; + } + /* Roll pulse over after 10 hours */ if (pulse >= (10 * 60 * 60 * PASSES_PER_SEC)) pulse = 0; @@ -813,6 +831,7 @@ point_update(); fflush(player_fl); } + if (auto_save && !(pulse % PULSE_AUTOSAVE)) { /* 1 minute */ if (++mins_since_crashsave >= autosave_time) { mins_since_crashsave = 0; @@ -820,9 +839,13 @@ House_save_all(); } } + if (!(pulse % PULSE_USAGE)) record_usage(); + if (!(pulse % PULSE_TIMESAVE)) + save_mud_time(&time_info); + /* Every pulse! Don't want them to stink the place up... */ extract_pending_chars(); } @@ -1225,7 +1248,6 @@ } /* create a new descriptor */ CREATE(newd, struct descriptor_data, 1); - memset((char *) newd, 0, sizeof(struct descriptor_data)); /* find the sitename */ if (nameserver_is_slow || !(from = gethostbyaddr((char *) &peer.sin_addr, @@ -1807,14 +1829,16 @@ } if (d->character) { - /* - * Plug memory leak, from Eric Green. - */ + /* If we're switched, this resets the mobile taken. */ + d->character->desc = NULL; + + /* Plug memory leak, from Eric Green. */ if (!IS_NPC(d->character) && PLR_FLAGGED(d->character, PLR_MAILING) && d->str) { if (*(d->str)) free(*(d->str)); free(d->str); } + if (STATE(d) == CON_PLAYING || STATE(d) == CON_DISCONNECT) { struct char_data *link_challenged = d->original ? d->original : d->character; @@ -1823,7 +1847,6 @@ save_char(link_challenged, NOWHERE); sprintf(buf, "Closing link to: %s.", GET_NAME(link_challenged)); mudlog(buf, NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(link_challenged)), TRUE); - link_challenged->desc = NULL; } else { sprintf(buf, "Losing player: %s.", GET_NAME(d->character) ? GET_NAME(d->character) : ""); @@ -1950,18 +1973,13 @@ RETSIGTYPE reread_wizlists(int sig) { - mudlog("Signal received - rereading wizlists.", CMP, LVL_IMMORT, TRUE); - reboot_wizlists(); + reread_wizlist = TRUE; } RETSIGTYPE unrestrict_game(int sig) { - mudlog("Received SIGUSR2 - completely unrestricting game (emergent)", - BRF, LVL_IMMORT, TRUE); - ban_list = NULL; - circle_restrict = 0; - num_invalid = 0; + emergency_unban = TRUE; } #ifdef CIRCLE_UNIX @@ -1974,6 +1992,7 @@ my_signal(SIGCHLD, reap); } +/* Dying anyway... */ RETSIGTYPE checkpointing(int sig) { if (!tics) { @@ -1983,6 +2002,8 @@ tics = 0; } + +/* Dying anyway... */ RETSIGTYPE hupsig(int sig) { log("SYSERR: Received SIGHUP, SIGINT, or SIGTERM. Shutting down..."); @@ -2009,7 +2030,7 @@ #ifndef POSIX #define my_signal(signo, func) signal(signo, func) #else -sigfunc *my_signal(int signo, sigfunc * func) +sigfunc *my_signal(int signo, sigfunc *func) { struct sigaction act, oact; Index: circle/src/comm.h diff -u circle/src/comm.h:1.10 circle/src/comm.h:1.11 --- circle/src/comm.h:1.10 Thu Jan 25 16:44:32 2001 +++ circle/src/comm.h Fri May 18 10:44:58 2001 @@ -43,8 +43,5 @@ #define SEND_TO_Q(messg, desc) write_to_output((messg), desc) -#define USING_SMALL(d) ((d)->output == (d)->small_outbuf) -#define USING_LARGE(d) ((d)->output == (d)->large_outbuf) - typedef RETSIGTYPE sigfunc(int); Index: circle/src/config.c diff -u circle/src/config.c:1.15 circle/src/config.c:1.17 --- circle/src/config.c:1.15 Tue May 18 19:29:31 1999 +++ circle/src/config.c Thu May 17 04:50:31 2001 @@ -63,6 +63,11 @@ /* number of movement points it costs to holler */ int holler_move_cost = 20; +/* how many people can get into a tunnel? The default is two, but there + * is also an alternate message in the case of one person being allowed. + */ +int tunnel_size = 2; + /* exp change limits */ int max_exp_gain = 100000; /* max gainable per kill */ int max_exp_loss = 500000; /* max losable per death */ Index: circle/src/constants.c diff -u circle/src/constants.c:1.18 circle/src/constants.c:1.23 --- circle/src/constants.c:1.18 Sat Feb 10 19:25:46 2001 +++ circle/src/constants.c Fri May 18 11:50:50 2001 @@ -15,7 +15,7 @@ #include "interpreter.h" /* alias_data */ cpp_extern const char *circlemud_version = - "CircleMUD, version 3.00 beta patchlevel 18"; + "CircleMUD, version 3.00 beta patchlevel 19"; /* strings corresponding to ordinals/bitvectors in structs.h ***********/ @@ -130,6 +130,7 @@ "NO_DEL", "INVST", "CRYO", + "DEAD", /* You should never see this. */ "\n" }; @@ -154,6 +155,7 @@ "NO_SLEEP", "NO_BASH", "NO_BLIND", + "DEAD", /* You should never see this. */ "\n" }; @@ -243,7 +245,7 @@ * WEAR_x - for eq list * Not use in sprinttype() so no \n. */ -const char *where[] = { +const char *wear_where[] = { " ", " ", " ", @@ -747,7 +749,7 @@ "the Day of the Deception", "the Day of Thunder", "the Day of Freedom", - "the day of the Great Gods", + "the Day of the Great Gods", "the Day of the Sun" }; Index: circle/src/constants.h diff -u circle/src/constants.h:1.3 circle/src/constants.h:1.4 --- circle/src/constants.h:1.3 Thu Jan 25 16:36:18 2001 +++ circle/src/constants.h Fri May 18 11:50:50 2001 @@ -10,7 +10,7 @@ extern const char *preference_bits[]; extern const char *affected_bits[]; extern const char *connected_types[]; -extern const char *where[]; +extern const char *wear_where[]; extern const char *equipment_types[]; extern const char *item_types[]; extern const char *wear_bits[]; Index: circle/src/db.c diff -u circle/src/db.c:1.58 circle/src/db.c:1.74 --- circle/src/db.c:1.58 Mon Mar 5 05:04:51 2001 +++ circle/src/db.c Thu Jul 26 15:15:55 2001 @@ -86,14 +86,14 @@ /* local functions */ int check_object_spell_number(struct obj_data *obj, int val); int check_object_level(struct obj_data *obj, int val); -void setup_dir(FILE * fl, int room, int dir); +void setup_dir(FILE *fl, int room, int dir); void index_boot(int mode); -void discrete_load(FILE * fl, int mode, char *filename); +void discrete_load(FILE *fl, int mode, char *filename); int check_object(struct obj_data *); -void parse_room(FILE * fl, int virtual_nr); -void parse_mobile(FILE * mob_f, int nr); -char *parse_object(FILE * obj_f, int nr); -void load_zones(FILE * fl, char *zonename); +void parse_room(FILE *fl, int virtual_nr); +void parse_mobile(FILE *mob_f, int nr); +char *parse_object(FILE *obj_f, int nr); +void load_zones(FILE *fl, char *zonename); void load_help(FILE *fl); void assign_mobiles(void); void assign_objects(void); @@ -108,14 +108,14 @@ ACMD(do_reboot); void boot_world(void); int count_alias_records(FILE *fl); -int count_hash_records(FILE * fl); +int count_hash_records(FILE *fl); bitvector_t asciiflag_conv(char *flag); void parse_simple_mob(FILE *mob_f, int i, int nr); void interpret_espec(const char *keyword, const char *value, int i, int nr); void parse_espec(char *buf, int i, int nr); void parse_enhanced_mob(FILE *mob_f, int i, int nr); void get_one_line(FILE *fl, char *buf); -void save_etext(struct char_data * ch); +void save_etext(struct char_data *ch); void check_start_rooms(void); void renum_world(void); void renum_zone_table(void); @@ -135,7 +135,7 @@ void sort_spells(void); void load_banned(void); void Read_Invalid_List(void); -void boot_the_shops(FILE * shop_f, char *filename, int rec_count); +void boot_the_shops(FILE *shop_f, char *filename, int rec_count); int find_name(char *name); int hsort(const void *a, const void *b); void prune_crlf(char *txt); @@ -351,8 +351,8 @@ } for (i = 0; i <= top_of_zone_table; i++) { - log("Resetting %s (rooms %d-%d).", zone_table[i].name, - (i ? (zone_table[i - 1].top + 1) : 0), zone_table[i].top); + log("Resetting #%d: %s (rooms %d-%d).", zone_table[i].number, + zone_table[i].name, zone_table[i].bot, zone_table[i].top); reset_zone(i); } @@ -367,12 +367,18 @@ /* reset the time in the game from file */ void reset_time(void) { -#if defined(CIRCLE_MACINTOSH) - long beginning_of_time = -1561789232; -#else - long beginning_of_time = 650336715; -#endif + time_t beginning_of_time = 0; + FILE *bgtime; + if ((bgtime = fopen(TIME_FILE, "r")) == NULL) + log("SYSERR: Can't read from '%s' time file.", TIME_FILE); + else { + fscanf(bgtime, "%ld\n", &beginning_of_time); + fclose(bgtime); + } + if (beginning_of_time == 0) + beginning_of_time = 650336715; + time_info = *mud_time_passed(time(0), beginning_of_time); if (time_info.hours <= 4) @@ -408,7 +414,20 @@ } +/* Write the time in 'when' to the MUD-time file. */ +void save_mud_time(struct time_info_data *when) +{ + FILE *bgtime; + if ((bgtime = fopen(TIME_FILE, "w")) == NULL) + log("SYSERR: Can't write to '%s' time file.", TIME_FILE); + else { + fprintf(bgtime, "%ld\n", mud_time_to_secs(when)); + fclose(bgtime); + } +} + + /* generate index table for the player file */ void build_player_index(void) { @@ -508,7 +527,7 @@ } /* function to count how many hash-mark delimited records exist in a file */ -int count_hash_records(FILE * fl) +int count_hash_records(FILE *fl) { char buf[128]; int count = 0; @@ -595,9 +614,6 @@ exit(1); } - /* Any idea why you put this here Jeremy? */ - rec_count++; - /* * NOTE: "bytes" does _not_ include strings or other later malloc'd things. */ @@ -675,10 +691,10 @@ } -void discrete_load(FILE * fl, int mode, char *filename) +void discrete_load(FILE *fl, int mode, char *filename) { int nr = -1, last; - char line[256]; + char line[READ_SIZE]; const char *modes[] = {"world", "mob", "obj"}; @@ -735,7 +751,7 @@ { bitvector_t flags = 0; int is_number = 1; - register char *p; + char *p; for (p = flag; *p; p++) { if (islower(*p)) @@ -755,16 +771,16 @@ /* load the rooms */ -void parse_room(FILE * fl, int virtual_nr) +void parse_room(FILE *fl, int virtual_nr) { static int room_nr = 0, zone = 0; int t[10], i; - char line[256], flags[128]; + char line[READ_SIZE], flags[128]; struct extra_descr_data *new_descr; sprintf(buf2, "room #%d", virtual_nr); - if (virtual_nr <= (zone ? zone_table[zone - 1].top : -1)) { + if (virtual_nr < zone_table[zone].bot) { log("SYSERR: Room #%d is below zone %d.", virtual_nr, zone); exit(1); } @@ -807,7 +823,7 @@ for (;;) { if (!get_line(fl, line)) { - log(buf); + log("%s", buf); exit(1); } switch (*line) { @@ -825,7 +841,7 @@ top_of_world = room_nr++; return; default: - log(buf); + log("%s", buf); exit(1); } } @@ -834,10 +850,10 @@ /* read direction data */ -void setup_dir(FILE * fl, int room, int dir) +void setup_dir(FILE *fl, int room, int dir) { int t[5]; - char line[256]; + char line[READ_SIZE]; sprintf(buf2, "room #%d, direction D%d", GET_ROOM_VNUM(room), dir); @@ -888,7 +904,7 @@ /* resolve all vnums into rnums in the world */ void renum_world(void) { - register int room, door; + int room, door; for (room = 0; room <= top_of_world; room++) for (door = 0; door < NUM_OF_DIRS; door++) @@ -958,7 +974,7 @@ void parse_simple_mob(FILE *mob_f, int i, int nr) { int j, t[10]; - char line[256]; + char line[READ_SIZE]; mob_proto[i].real_abils.str = 11; mob_proto[i].real_abils.intel = 11; @@ -980,21 +996,21 @@ } GET_LEVEL(mob_proto + i) = t[0]; - mob_proto[i].points.hitroll = 20 - t[1]; - mob_proto[i].points.armor = 10 * t[2]; + GET_HITROLL(mob_proto + i) = 20 - t[1]; + GET_AC(mob_proto + i) = 10 * t[2]; /* max hit = 0 is a flag that H, M, V is xdy+z */ - mob_proto[i].points.max_hit = 0; - mob_proto[i].points.hit = t[3]; - mob_proto[i].points.mana = t[4]; - mob_proto[i].points.move = t[5]; + GET_MAX_HIT(mob_proto + i) = 0; + GET_HIT(mob_proto + i) = t[3]; + GET_MANA(mob_proto + i) = t[4]; + GET_MOVE(mob_proto + i) = t[5]; - mob_proto[i].points.max_mana = 10; - mob_proto[i].points.max_move = 50; + GET_MAX_MANA(mob_proto + i) = 10; + GET_MAX_MOVE(mob_proto + i) = 50; mob_proto[i].mob_specials.damnodice = t[6]; mob_proto[i].mob_specials.damsizedice = t[7]; - mob_proto[i].points.damroll = t[8]; + GET_DAMROLL(mob_proto + i) = t[8]; if (!get_line(mob_f, line)) { log("SYSERR: Format error in mob #%d, second line after S flag\n" @@ -1023,13 +1039,13 @@ exit(1); } - mob_proto[i].char_specials.position = t[0]; - mob_proto[i].mob_specials.default_pos = t[1]; - mob_proto[i].player.sex = t[2]; - - mob_proto[i].player.chclass = 0; - mob_proto[i].player.weight = 200; - mob_proto[i].player.height = 198; + GET_POS(mob_proto + i) = t[0]; + GET_DEFAULT_POS(mob_proto + i) = t[1]; + GET_SEX(mob_proto + i) = t[2]; + + GET_CLASS(mob_proto + i) = 0; + GET_WEIGHT(mob_proto + i) = 200; + GET_HEIGHT(mob_proto + i) = 198; /* * these are now save applies; base save numbers for MOBs are now from @@ -1045,16 +1061,30 @@ * and assigns the correct value to the mob as appropriate. Adding new * e-specs is absurdly easy -- just add a new CASE statement to this * function! No other changes need to be made anywhere in the code. + * + * CASE : Requires a parameter through 'value'. + * BOOL_CASE : Being specified at all is its value. */ + +#define CASE(test) \ + if (value && !matched && !str_cmp(keyword, test) && (matched = TRUE)) -#define CASE(test) if (!matched && !str_cmp(keyword, test) && (matched = 1)) -#define RANGE(low, high) (num_arg = MAX((low), MIN((high), (num_arg)))) +#define BOOL_CASE(test) \ + if (!value && !matched && !str_cmp(keyword, test) && (matched = TRUE)) +#define RANGE(low, high) \ + (num_arg = MAX((low), MIN((high), (num_arg)))) + void interpret_espec(const char *keyword, const char *value, int i, int nr) { - int num_arg, matched = 0; + int num_arg = 0, matched = FALSE; - num_arg = atoi(value); + /* + * If there isn't a colon, there is no value. While Boolean options are + * possible, we don't actually have any. Feel free to make some. + */ + if (value) + num_arg = atoi(value); CASE("BareHandAttack") { RANGE(0, 99); @@ -1103,6 +1133,7 @@ } #undef CASE +#undef BOOL_CASE #undef RANGE void parse_espec(char *buf, int i, int nr) @@ -1113,19 +1144,14 @@ *(ptr++) = '\0'; while (isspace(*ptr)) ptr++; -#if 0 /* Need to evaluate interpret_espec()'s NULL handling. */ } -#else - } else - ptr = ""; -#endif interpret_espec(buf, ptr, i, nr); } void parse_enhanced_mob(FILE *mob_f, int i, int nr) { - char line[256]; + char line[READ_SIZE]; parse_simple_mob(mob_f, i, nr); @@ -1144,11 +1170,11 @@ } -void parse_mobile(FILE * mob_f, int nr) +void parse_mobile(FILE *mob_f, int nr) { static int i = 0; int j, t[10]; - char line[256], *tmpptr, letter; + char line[READ_SIZE], *tmpptr, letter; char f1[128], f2[128]; mob_index[i].vnum = nr; @@ -1174,7 +1200,7 @@ *tmpptr = LOWER(*tmpptr); mob_proto[i].player.long_descr = fread_string(mob_f, buf2); mob_proto[i].player.description = fread_string(mob_f, buf2); - mob_proto[i].player.title = NULL; + GET_TITLE(mob_proto + i) = NULL; /* *** Numeric data *** */ if (!get_line(mob_f, line)) { @@ -1197,6 +1223,12 @@ AFF_FLAGS(mob_proto + i) = asciiflag_conv(f2); GET_ALIGNMENT(mob_proto + i) = t[2]; + /* Rather bad to load mobiles with this bit already set. */ + if (MOB_FLAGGED(mob_proto + i, MOB_NOTDEADYET)) { + log("SYSERR: Mob #%d has reserved bit MOB_NOTDEADYET set.", nr); + REMOVE_BIT(MOB_FLAGS(mob_proto + i), MOB_NOTDEADYET); + } + /* AGGR_TO_ALIGN is ignored if the mob is AGGRESSIVE. */ if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_GOOD | MOB_AGGR_EVIL | MOB_AGGR_NEUTRAL)) log("SYSERR: Mob #%d both Aggressive and Aggressive_to_Alignment.", nr); @@ -1229,13 +1261,13 @@ /* read all objects from obj file; generate index and prototypes */ -char *parse_object(FILE * obj_f, int nr) +char *parse_object(FILE *obj_f, int nr) { static int i = 0; - static char line[256]; + static char line[READ_SIZE]; int t[10], j, retval; char *tmpptr; - char f1[256], f2[256]; + char f1[READ_SIZE], f2[READ_SIZE]; struct extra_descr_data *new_descr; obj_index[i].vnum = nr; @@ -1272,9 +1304,9 @@ log("SYSERR: Format error in first numeric line (expecting 3 args, got %d), %s", retval, buf2); exit(1); } - obj_proto[i].obj_flags.type_flag = t[0]; - obj_proto[i].obj_flags.extra_flags = asciiflag_conv(f1); - obj_proto[i].obj_flags.wear_flags = asciiflag_conv(f2); + GET_OBJ_TYPE(obj_proto + i) = t[0]; + GET_OBJ_EXTRA(obj_proto + i) = asciiflag_conv(f1); + GET_OBJ_WEAR(obj_proto + i) = asciiflag_conv(f2); if (!get_line(obj_f, line)) { log("SYSERR: Expecting second numeric line of %s, but file ended!", buf2); @@ -1284,10 +1316,10 @@ log("SYSERR: Format error in second numeric line (expecting 4 args, got %d), %s", retval, buf2); exit(1); } - obj_proto[i].obj_flags.value[0] = t[0]; - obj_proto[i].obj_flags.value[1] = t[1]; - obj_proto[i].obj_flags.value[2] = t[2]; - obj_proto[i].obj_flags.value[3] = t[3]; + GET_OBJ_VAL(obj_proto + i, 0) = t[0]; + GET_OBJ_VAL(obj_proto + i, 1) = t[1]; + GET_OBJ_VAL(obj_proto + i, 2) = t[2]; + GET_OBJ_VAL(obj_proto + i, 3) = t[3]; if (!get_line(obj_f, line)) { log("SYSERR: Expecting third numeric line of %s, but file ended!", buf2); @@ -1297,15 +1329,14 @@ log("SYSERR: Format error in third numeric line (expecting 3 args, got %d), %s", retval, buf2); exit(1); } - obj_proto[i].obj_flags.weight = t[0]; - obj_proto[i].obj_flags.cost = t[1]; - obj_proto[i].obj_flags.cost_per_day = t[2]; + GET_OBJ_WEIGHT(obj_proto + i) = t[0]; + GET_OBJ_COST(obj_proto + i) = t[1]; + GET_OBJ_RENT(obj_proto + i) = t[2]; /* check to make sure that weight of containers exceeds curr. quantity */ - if (obj_proto[i].obj_flags.type_flag == ITEM_DRINKCON || - obj_proto[i].obj_flags.type_flag == ITEM_FOUNTAIN) { - if (obj_proto[i].obj_flags.weight < obj_proto[i].obj_flags.value[1]) - obj_proto[i].obj_flags.weight = obj_proto[i].obj_flags.value[1] + 5; + if (GET_OBJ_TYPE(obj_proto + i) == ITEM_DRINKCON || GET_OBJ_TYPE(obj_proto + i) == ITEM_FOUNTAIN) { + if (GET_OBJ_WEIGHT(obj_proto + i) < GET_OBJ_VAL(obj_proto + i, 1)) + GET_OBJ_WEIGHT(obj_proto + i) = GET_OBJ_VAL(obj_proto + i, 1) + 5; } /* *** extra descriptions and affect fields *** */ @@ -1355,7 +1386,7 @@ break; case '$': case '#': - check_object(&obj_proto[i]); + check_object(obj_proto + i); top_of_objt = i++; return (line); default: @@ -1369,11 +1400,11 @@ #define Z zone_table[zone] /* load the zone table and command tables */ -void load_zones(FILE * fl, char *zonename) +void load_zones(FILE *fl, char *zonename) { static zone_rnum zone = 0; int cmd_no, num_of_cmds = 0, line_num = 0, tmp, error; - char *ptr, buf[256], zname[256]; + char *ptr, buf[READ_SIZE], zname[READ_SIZE]; strcpy(zname, zonename); @@ -1381,9 +1412,12 @@ for (tmp = 0; tmp < 3; tmp++) get_line(fl, buf); - /* More accurate count. Previous was always 4 or 5 too high. -gg 2001/1/17 */ + /* More accurate count. Previous was always 4 or 5 too high. -gg 2001/1/17 + * Note that if a new zone command is added to reset_zone(), this string + * will need to be updated to suit. - ae. + */ while (get_line(fl, buf)) - if ((strchr("MOGEPDR", buf[0]) && buf[1] == ' ') || (buf[0] == 'S' && buf[1] == '\0')) + if ((strchr("MOPGERD", buf[0]) && buf[1] == ' ') || (buf[0] == 'S' && buf[1] == '\0')) num_of_cmds++; rewind(fl); @@ -1408,10 +1442,15 @@ Z.name = str_dup(buf); line_num += get_line(fl, buf); - if (sscanf(buf, " %hd %d %d ", &Z.top, &Z.lifespan, &Z.reset_mode) != 3) { - log("SYSERR: Format error in 3-constant line of %s", zname); + if (sscanf(buf, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { + log("SYSERR: Format error in numeric constant line of %s", zname); + exit(1); + } + if (Z.bot > Z.top) { + log("SYSERR: Zone %d bottom (%d) > top (%d).", Z.number, Z.bot, Z.top); exit(1); } + cmd_no = 0; for (;;) { @@ -1527,9 +1566,8 @@ * procedures for resetting, both play-time and boot-time * *************************************************************************/ - -int vnum_mobile(char *searchname, struct char_data * ch) +int vnum_mobile(char *searchname, struct char_data *ch) { int nr, found = 0; @@ -1547,7 +1585,7 @@ -int vnum_object(char *searchname, struct char_data * ch) +int vnum_object(char *searchname, struct char_data *ch) { int nr, found = 0; @@ -1764,6 +1802,11 @@ if (ZCMD.if_flag && !last_cmd) continue; + /* This is the list of actual zone commands. If any new + * zone commands are added to the game, be certain to update + * the list of commands in load_zone() so that the counting + * will still be correct. - ae. + */ switch (ZCMD.command) { case '*': /* ignore command */ last_cmd = 0; @@ -1956,7 +1999,7 @@ /* Load a char, TRUE if loaded, FALSE if not */ -int load_char(char *name, struct char_file_u * char_element) +int load_char(char *name, struct char_file_u *char_element) { int player_i; @@ -1976,7 +2019,7 @@ * * NOTE: load_room should be an *RNUM* now. It is converted to a vnum here. */ -void save_char(struct char_data * ch, room_rnum load_room) +void save_char(struct char_data *ch, room_rnum load_room) { struct char_file_u st; @@ -2002,7 +2045,7 @@ /* copy data from the file structure to a char struct */ -void store_to_char(struct char_file_u * st, struct char_data * ch) +void store_to_char(struct char_file_u *st, struct char_data *ch) { int i; @@ -2073,7 +2116,7 @@ /* copy vital data from a players char-structure to the file structure */ -void char_to_store(struct char_data * ch, struct char_file_u * st) +void char_to_store(struct char_data *ch, struct char_file_u *st) { int i; struct affected_type *af; @@ -2145,9 +2188,16 @@ else *st->title = '\0'; - if (ch->player.description) + if (ch->player.description) { + if (strlen(ch->player.description) >= EXDSCR_LENGTH) { + log("SYSERR: char_to_store: %s's description length: %d, max: %d! " + "Truncated.", GET_PC_NAME(ch), strlen(ch->player.description), + EXDSCR_LENGTH); + ch->player.description[EXDSCR_LENGTH - 3] = '\0'; + strcat(ch->player.description, "\r\n"); + } strcpy(st->description, ch->player.description); - else + } else *st->description = '\0'; strcpy(st->name, GET_NAME(ch)); @@ -2168,10 +2218,9 @@ -void save_etext(struct char_data * ch) +void save_etext(struct char_data *ch) { /* this will be really cool soon */ - } @@ -2211,10 +2260,10 @@ /* read and allocate space for a '~'-terminated string from a given file */ -char *fread_string(FILE * fl, const char *error) +char *fread_string(FILE *fl, const char *error) { char buf[MAX_STRING_LENGTH], tmp[512], *rslt; - register char *point; + char *point; int done = 0, length = 0, templength; *buf = '\0'; @@ -2239,7 +2288,7 @@ if (length + templength >= MAX_STRING_LENGTH) { log("SYSERR: fread_string: string too large (db.c)"); - log(error); + log("%s", error); exit(1); } else { strcat(buf + length, tmp); @@ -2259,7 +2308,7 @@ /* release memory allocated for a char struct */ -void free_char(struct char_data * ch) +void free_char(struct char_data *ch) { int i; struct alias_data *a; @@ -2315,7 +2364,7 @@ /* release memory allocated for an obj struct */ -void free_obj(struct obj_data * obj) +void free_obj(struct obj_data *obj) { int nr; struct extra_descr_data *thisd, *next_one; @@ -2435,7 +2484,7 @@ /* clear some of the the working variables of a char */ -void reset_char(struct char_data * ch) +void reset_char(struct char_data *ch) { int i; @@ -2468,7 +2517,7 @@ /* clear ALL the working variables of a char; do NOT free any space alloc'ed */ -void clear_char(struct char_data * ch) +void clear_char(struct char_data *ch) { memset((char *) ch, 0, sizeof(struct char_data)); @@ -2485,7 +2534,7 @@ } -void clear_object(struct obj_data * obj) +void clear_object(struct obj_data *obj) { memset((char *) obj, 0, sizeof(struct obj_data)); @@ -2498,7 +2547,7 @@ /* initialize a new character only if class is set */ -void init_char(struct char_data * ch) +void init_char(struct char_data *ch) { int i; @@ -2619,7 +2668,7 @@ if ((mob_index + mid)->vnum == vnum) return (mid); if (bot >= top) - return (-1); + return (NOBODY); if ((mob_index + mid)->vnum > vnum) top = mid - 1; else @@ -2628,7 +2677,6 @@ } - /* returns the real number of the object with given virtual number */ obj_rnum real_object(obj_vnum vnum) { @@ -2644,13 +2692,38 @@ if ((obj_index + mid)->vnum == vnum) return (mid); if (bot >= top) - return (-1); + return (NOTHING); if ((obj_index + mid)->vnum > vnum) top = mid - 1; else bot = mid + 1; } } + + +/* returns the real number of the zone with given virtual number */ +room_rnum real_zone(room_vnum vnum) +{ + room_rnum bot, top, mid; + + bot = 0; + top = top_of_zone_table; + + /* perform binary search on zone-table */ + for (;;) { + mid = (bot + top) / 2; + + if ((zone_table + mid)->number == vnum) + return (mid); + if (bot >= top) + return (NOWHERE); + if ((zone_table + mid)->number > vnum) + top = mid - 1; + else + bot = mid + 1; + } +} + /* * Extend later to include more checks. Index: circle/src/db.h diff -u circle/src/db.h:1.13 circle/src/db.h:1.18 --- circle/src/db.h:1.13 Sun Mar 4 18:47:08 2001 +++ circle/src/db.h Thu Jul 26 15:15:55 2001 @@ -70,39 +70,45 @@ #define SHP_PREFIX LIB_WORLD"shp"SLASH /* shop definitions */ #define HLP_PREFIX LIB_TEXT"help"SLASH /* for HELP */ -#define CREDITS_FILE LIB_TEXT"credits"/* for the 'credits' command */ +#define CREDITS_FILE LIB_TEXT"credits" /* for the 'credits' command */ #define NEWS_FILE LIB_TEXT"news" /* for the 'news' command */ #define MOTD_FILE LIB_TEXT"motd" /* messages of the day / mortal */ #define IMOTD_FILE LIB_TEXT"imotd" /* messages of the day / immort */ #define GREETINGS_FILE LIB_TEXT"greetings" /* The opening screen. */ -#define HELP_PAGE_FILE LIB_TEXT_HELP"screen" /* for HELP */ +#define HELP_PAGE_FILE LIB_TEXT_HELP"screen" /* for HELP */ #define INFO_FILE LIB_TEXT"info" /* for INFO */ #define WIZLIST_FILE LIB_TEXT"wizlist" /* for WIZLIST */ #define IMMLIST_FILE LIB_TEXT"immlist" /* for IMMLIST */ #define BACKGROUND_FILE LIB_TEXT"background"/* for the background story */ -#define POLICIES_FILE LIB_TEXT"policies" /* player policies/rules */ -#define HANDBOOK_FILE LIB_TEXT"handbook" /* handbook for new immorts */ +#define POLICIES_FILE LIB_TEXT"policies" /* player policies/rules */ +#define HANDBOOK_FILE LIB_TEXT"handbook" /* handbook for new immorts */ -#define IDEA_FILE LIB_MISC"ideas" /* for the 'idea'-command */ -#define TYPO_FILE LIB_MISC"typos" /* 'typo' */ -#define BUG_FILE LIB_MISC"bugs" /* 'bug' */ +#define IDEA_FILE LIB_MISC"ideas" /* for the 'idea'-command */ +#define TYPO_FILE LIB_MISC"typos" /* 'typo' */ +#define BUG_FILE LIB_MISC"bugs" /* 'bug' */ #define MESS_FILE LIB_MISC"messages" /* damage messages */ -#define SOCMESS_FILE LIB_MISC"socials" /* messgs for social acts */ -#define XNAME_FILE LIB_MISC"xnames" /* invalid name substrings */ +#define SOCMESS_FILE LIB_MISC"socials" /* messages for social acts */ +#define XNAME_FILE LIB_MISC"xnames" /* invalid name substrings */ -#define PLAYER_FILE LIB_ETC"players" /* the player database */ -#define MAIL_FILE LIB_ETC"plrmail" /* for the mudmail system */ -#define BAN_FILE LIB_ETC"badsites" /* for the siteban system */ +#define PLAYER_FILE LIB_ETC"players" /* the player database */ +#define MAIL_FILE LIB_ETC"plrmail" /* for the mudmail system */ +#define BAN_FILE LIB_ETC"badsites" /* for the siteban system */ #define HCONTROL_FILE LIB_ETC"hcontrol" /* for the house system */ +#define TIME_FILE LIB_ETC"time" /* for calendar system */ /* public procedures in db.c */ void boot_db(void); int create_entry(char *name); void zone_update(void); -room_rnum real_room(room_vnum vnum); char *fread_string(FILE *fl, const char *error); long get_id_by_name(char *name); char *get_name_by_id(long id); +void save_mud_time(struct time_info_data *when); + +zone_rnum real_zone(zone_vnum vnum); +room_rnum real_room(room_vnum vnum); +mob_rnum real_mobile(mob_vnum vnum); +obj_rnum real_object(obj_vnum vnum); void char_to_store(struct char_data *ch, struct char_file_u *st); void store_to_char(struct char_file_u *st, struct char_data *ch); @@ -111,7 +117,6 @@ void init_char(struct char_data *ch); struct char_data* create_char(void); struct char_data *read_mobile(mob_vnum nr, int type); -mob_rnum real_mobile(mob_vnum vnum); int vnum_mobile(char *searchname, struct char_data *ch); void clear_char(struct char_data *ch); void reset_char(struct char_data *ch); @@ -120,7 +125,6 @@ struct obj_data *create_obj(void); void clear_object(struct obj_data *obj); void free_obj(struct obj_data *obj); -obj_rnum real_object(obj_vnum vnum); struct obj_data *read_object(obj_vnum nr, int type); int vnum_object(char *searchname, struct char_data *ch); @@ -156,6 +160,7 @@ char *name; /* name of this zone */ int lifespan; /* how long between resets (minutes) */ int age; /* current age of this zone (minutes) */ + room_vnum bot; /* starting room number for this zone */ room_vnum top; /* upper limit for rooms in this zone */ int reset_mode; /* conditions for reset (see below) */ @@ -225,8 +230,21 @@ char buf2[MAX_STRING_LENGTH]; char arg[MAX_STRING_LENGTH]; #else +extern struct room_data *world; extern room_rnum top_of_world; +extern struct zone_data *zone_table; + +extern struct descriptor_data *descriptor_list; +extern struct char_data *character_list; extern struct player_special_data dummy_mob; + +extern struct index_data *mob_index; +extern struct char_data *mob_proto; + +extern struct index_data *obj_index; +extern struct obj_data *object_list; +extern struct obj_data *obj_proto; + extern char buf[MAX_STRING_LENGTH]; extern char buf1[MAX_STRING_LENGTH]; extern char buf2[MAX_STRING_LENGTH]; Index: circle/src/fight.c diff -u circle/src/fight.c:1.20 circle/src/fight.c:1.23 --- circle/src/fight.c:1.20 Sun Mar 18 18:58:58 2001 +++ circle/src/fight.c Thu Jun 28 08:03:52 2001 @@ -27,35 +27,32 @@ struct char_data *next_combat_list = NULL; /* External structures */ -extern struct index_data *mob_index; -extern struct room_data *world; extern struct message_list fight_messages[MAX_MESSAGES]; -extern struct obj_data *object_list; extern int pk_allowed; /* see config.c */ extern int max_exp_gain; /* see config.c */ extern int max_exp_loss; /* see config.c */ extern int max_npc_corpse_time, max_pc_corpse_time; /* External procedures */ -char *fread_action(FILE * fl, int nr); +char *fread_action(FILE *fl, int nr); ACMD(do_flee); int backstab_mult(int level); int thaco(int ch_class, int level); -int ok_damage_shopkeeper(struct char_data * ch, struct char_data * victim); +int ok_damage_shopkeeper(struct char_data *ch, struct char_data *victim); /* local functions */ -void perform_group_gain(struct char_data * ch, int base, struct char_data * victim); -void dam_message(int dam, struct char_data * ch, struct char_data * victim, int w_type); -void appear(struct char_data * ch); +void perform_group_gain(struct char_data *ch, int base, struct char_data *victim); +void dam_message(int dam, struct char_data *ch, struct char_data *victim, int w_type); +void appear(struct char_data *ch); void load_messages(void); -void check_killer(struct char_data * ch, struct char_data * vict); -void make_corpse(struct char_data * ch); -void change_alignment(struct char_data * ch, struct char_data * victim); -void death_cry(struct char_data * ch); -void raw_kill(struct char_data * ch); -void die(struct char_data * ch); -void group_gain(struct char_data * ch, struct char_data * victim); -void solo_gain(struct char_data * ch, struct char_data * victim); +void check_killer(struct char_data *ch, struct char_data *vict); +void make_corpse(struct char_data *ch); +void change_alignment(struct char_data *ch, struct char_data *victim); +void death_cry(struct char_data *ch); +void raw_kill(struct char_data *ch); +void die(struct char_data *ch); +void group_gain(struct char_data *ch, struct char_data *victim); +void solo_gain(struct char_data *ch, struct char_data *victim); char *replace_string(const char *str, const char *weapon_singular, const char *weapon_plural); void perform_violence(void); int compute_armor_class(struct char_data *ch); @@ -85,7 +82,7 @@ /* The Fight related routines */ -void appear(struct char_data * ch) +void appear(struct char_data *ch) { if (affected_by_spell(ch, SPELL_INVISIBLE)) affect_from_char(ch, SPELL_INVISIBLE); @@ -169,7 +166,7 @@ } -void update_pos(struct char_data * victim) +void update_pos(struct char_data *victim) { if ((GET_HIT(victim) > 0) && (GET_POS(victim) > POS_STUNNED)) return; @@ -186,7 +183,7 @@ } -void check_killer(struct char_data * ch, struct char_data * vict) +void check_killer(struct char_data *ch, struct char_data *vict) { char buf[256]; @@ -204,7 +201,7 @@ /* start one char fighting another (yes, it is horrible, I know... ) */ -void set_fighting(struct char_data * ch, struct char_data * vict) +void set_fighting(struct char_data *ch, struct char_data *vict) { if (ch == vict) return; @@ -230,7 +227,7 @@ /* remove a char from the list of fighting chars */ -void stop_fighting(struct char_data * ch) +void stop_fighting(struct char_data *ch) { struct char_data *temp; @@ -246,7 +243,7 @@ -void make_corpse(struct char_data * ch) +void make_corpse(struct char_data *ch) { struct obj_data *corpse, *o; struct obj_data *money; @@ -305,7 +302,7 @@ /* When ch kills victim */ -void change_alignment(struct char_data * ch, struct char_data * victim) +void change_alignment(struct char_data *ch, struct char_data *victim) { /* * new alignment change algorithm: if you kill a monster with alignment A, @@ -316,7 +313,7 @@ -void death_cry(struct char_data * ch) +void death_cry(struct char_data *ch) { int door; @@ -330,7 +327,7 @@ -void raw_kill(struct char_data * ch) +void raw_kill(struct char_data *ch) { if (FIGHTING(ch)) stop_fighting(ch); @@ -346,7 +343,7 @@ -void die(struct char_data * ch) +void die(struct char_data *ch) { gain_exp(ch, -(GET_EXP(ch) / 2)); if (!IS_NPC(ch)) @@ -356,8 +353,8 @@ -void perform_group_gain(struct char_data * ch, int base, - struct char_data * victim) +void perform_group_gain(struct char_data *ch, int base, + struct char_data *victim) { int share; @@ -374,7 +371,7 @@ } -void group_gain(struct char_data * ch, struct char_data * victim) +void group_gain(struct char_data *ch, struct char_data *victim) { int tot_members, base, tot_gain; struct char_data *k; @@ -413,7 +410,7 @@ } -void solo_gain(struct char_data * ch, struct char_data * victim) +void solo_gain(struct char_data *ch, struct char_data *victim) { int exp; @@ -467,7 +464,7 @@ /* message for doing damage with a weapon */ -void dam_message(int dam, struct char_data * ch, struct char_data * victim, +void dam_message(int dam, struct char_data *ch, struct char_data *victim, int w_type) { char *buf; @@ -571,10 +568,10 @@ /* - * message for doing damage with a spell or skill + * message for doing damage with a spell or skill * C3.0: Also used for weapon damage on miss and death blows */ -int skill_message(int dam, struct char_data * ch, struct char_data * vict, +int skill_message(int dam, struct char_data *ch, struct char_data *vict, int attacktype) { int i, j, nr; @@ -593,10 +590,16 @@ act(msg->god_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT); act(msg->god_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT); } else if (dam != 0) { + /* + * Don't send redundant color codes for TYPE_SUFFERING & other types + * of damage without attacker_msg. + */ if (GET_POS(vict) == POS_DEAD) { - send_to_char(CCYEL(ch, C_CMP), ch); - act(msg->die_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); - send_to_char(CCNRM(ch, C_CMP), ch); + if (msg->die_msg.attacker_msg) { + send_to_char(CCYEL(ch, C_CMP), ch); + act(msg->die_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); + send_to_char(CCNRM(ch, C_CMP), ch); + } send_to_char(CCRED(vict, C_CMP), vict); act(msg->die_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP); @@ -604,9 +607,11 @@ act(msg->die_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT); } else { - send_to_char(CCYEL(ch, C_CMP), ch); - act(msg->hit_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); - send_to_char(CCNRM(ch, C_CMP), ch); + if (msg->hit_msg.attacker_msg) { + send_to_char(CCYEL(ch, C_CMP), ch); + act(msg->hit_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); + send_to_char(CCNRM(ch, C_CMP), ch); + } send_to_char(CCRED(vict, C_CMP), vict); act(msg->hit_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP); @@ -615,9 +620,11 @@ act(msg->hit_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT); } } else if (ch != vict) { /* Dam == 0 */ - send_to_char(CCYEL(ch, C_CMP), ch); - act(msg->miss_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); - send_to_char(CCNRM(ch, C_CMP), ch); + if (msg->miss_msg.attacker_msg) { + send_to_char(CCYEL(ch, C_CMP), ch); + act(msg->miss_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); + send_to_char(CCNRM(ch, C_CMP), ch); + } send_to_char(CCRED(vict, C_CMP), vict); act(msg->miss_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP); @@ -637,7 +644,7 @@ * = 0 No damage. * > 0 How much damage done. */ -int damage(struct char_data * ch, struct char_data * victim, int dam, int attacktype) +int damage(struct char_data *ch, struct char_data *victim, int dam, int attacktype) { if (GET_POS(victim) <= POS_DEAD) { /* This is "normal"-ish now with delayed extraction. -gg 3/15/2001 */ @@ -805,7 +812,7 @@ -void hit(struct char_data * ch, struct char_data * victim, int type) +void hit(struct char_data *ch, struct char_data *victim, int type) { struct obj_data *wielded = GET_EQ(ch, WEAR_WIELD); int w_type, victim_ac, calc_thaco, dam, diceroll; Index: circle/src/graph.c diff -u circle/src/graph.c:1.14 circle/src/graph.c:1.17 --- circle/src/graph.c:1.14 Thu Jan 25 16:50:43 2001 +++ circle/src/graph.c Thu Jun 28 08:03:52 2001 @@ -21,20 +21,21 @@ #include "spells.h" -/* Externals */ +/* external functions */ ACMD(do_say); -extern struct char_data *character_list; + +/* external variables */ extern const char *dirs[]; -extern struct room_data *world; extern int track_through_doors; /* local functions */ +int VALID_EDGE(room_rnum x, int y); void bfs_enqueue(room_rnum room, int dir); void bfs_dequeue(void); void bfs_clear_queue(void); int find_first_step(room_rnum src, room_rnum target); ACMD(do_track); -void hunt_victim(struct char_data * ch); +void hunt_victim(struct char_data *ch); struct bfs_queue_struct { room_rnum room; @@ -215,7 +216,7 @@ } -void hunt_victim(struct char_data * ch) +void hunt_victim(struct char_data *ch) { int dir; byte found; Index: circle/src/handler.c diff -u circle/src/handler.c:1.26 circle/src/handler.c:1.36 --- circle/src/handler.c:1.26 Sun Mar 18 18:58:58 2001 +++ circle/src/handler.c Thu Jul 26 15:14:18 2001 @@ -25,30 +25,24 @@ /* external vars */ extern struct char_data *combat_list; -extern struct room_data *world; -extern struct obj_data *object_list; -extern struct char_data *character_list; -extern struct index_data *mob_index; -extern struct index_data *obj_index; -extern struct descriptor_data *descriptor_list; extern const char *MENU; /* local functions */ -int apply_ac(struct char_data * ch, int eq_pos); -void update_object(struct obj_data * obj, int use); -void update_char_objects(struct char_data * ch); +int apply_ac(struct char_data *ch, int eq_pos); +void update_object(struct obj_data *obj, int use); +void update_char_objects(struct char_data *ch); /* external functions */ int invalid_class(struct char_data *ch, struct obj_data *obj); -void remove_follower(struct char_data * ch); -void clearMemory(struct char_data * ch); -void die_follower(struct char_data * ch); +void remove_follower(struct char_data *ch); +void clearMemory(struct char_data *ch); +void die_follower(struct char_data *ch); ACMD(do_return); char *fname(const char *namelist) { static char holder[30]; - register char *point; + char *point; for (point = holder; isalpha(*namelist); namelist++, point++) *point = *namelist; @@ -90,7 +84,7 @@ -void affect_modify(struct char_data * ch, byte loc, sbyte mod, +void affect_modify(struct char_data *ch, byte loc, sbyte mod, bitvector_t bitv, bool add) { if (add) @@ -212,7 +206,7 @@ /* This updates a character by subtracting everything he is affected by */ /* restoring original abilities, and then affecting all again */ -void affect_total(struct char_data * ch) +void affect_total(struct char_data *ch) { struct affected_type *af; int i, j; @@ -251,6 +245,7 @@ GET_INT(ch) = MAX(0, MIN(GET_INT(ch), i)); GET_WIS(ch) = MAX(0, MIN(GET_WIS(ch), i)); GET_CON(ch) = MAX(0, MIN(GET_CON(ch), i)); + GET_CHA(ch) = MAX(0, MIN(GET_CHA(ch), i)); GET_STR(ch) = MAX(0, GET_STR(ch)); if (IS_NPC(ch)) { @@ -268,7 +263,7 @@ /* Insert an affect_type in a char_data structure Automatically sets apropriate bits and apply's */ -void affect_to_char(struct char_data * ch, struct affected_type * af) +void affect_to_char(struct char_data *ch, struct affected_type *af) { struct affected_type *affected_alloc; @@ -289,7 +284,7 @@ * reaches zero). Pointer *af must never be NIL! Frees mem and calls * affect_location_apply */ -void affect_remove(struct char_data * ch, struct affected_type * af) +void affect_remove(struct char_data *ch, struct affected_type *af) { struct affected_type *temp; @@ -307,7 +302,7 @@ /* Call affect_remove with every spell of spelltype "skill" */ -void affect_from_char(struct char_data * ch, int type) +void affect_from_char(struct char_data *ch, int type) { struct affected_type *hjp, *next; @@ -324,7 +319,7 @@ * Return TRUE if a char is affected by a spell (SPELL_XXX), * FALSE indicates not affected. */ -bool affected_by_spell(struct char_data * ch, int type) +bool affected_by_spell(struct char_data *ch, int type) { struct affected_type *hjp; @@ -337,7 +332,7 @@ -void affect_join(struct char_data * ch, struct affected_type * af, +void affect_join(struct char_data *ch, struct affected_type *af, bool add_dur, bool avg_dur, bool add_mod, bool avg_mod) { struct affected_type *hjp, *next; @@ -368,7 +363,7 @@ /* move a player out of a room */ -void char_from_room(struct char_data * ch) +void char_from_room(struct char_data *ch) { struct char_data *temp; @@ -392,7 +387,7 @@ /* place a character in a room */ -void char_to_room(struct char_data * ch, room_rnum room) +void char_to_room(struct char_data *ch, room_rnum room) { if (ch == NULL || room < 0 || room > top_of_world) log("SYSERR: Illegal value(s) passed to char_to_room. (Room: %d/%d Ch: %p", @@ -417,7 +412,7 @@ /* give an object to a char */ -void obj_to_char(struct obj_data * object, struct char_data * ch) +void obj_to_char(struct obj_data *object, struct char_data *ch) { if (object && ch) { object->next_content = ch->carrying; @@ -436,7 +431,7 @@ /* take an object from a char */ -void obj_from_char(struct obj_data * object) +void obj_from_char(struct obj_data *object) { struct obj_data *temp; @@ -459,7 +454,7 @@ /* Return the effect of a piece of armor in position eq_pos */ -int apply_ac(struct char_data * ch, int eq_pos) +int apply_ac(struct char_data *ch, int eq_pos) { int factor; @@ -492,16 +487,16 @@ int invalid_align(struct char_data *ch, struct obj_data *obj) { - if (IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) && IS_EVIL(ch)) + if (OBJ_FLAGGED(obj, ITEM_ANTI_EVIL) && IS_EVIL(ch)) return TRUE; - if (IS_OBJ_STAT(obj, ITEM_ANTI_GOOD) && IS_GOOD(ch)) + if (OBJ_FLAGGED(obj, ITEM_ANTI_GOOD) && IS_GOOD(ch)) return TRUE; - if (IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL) && IS_NEUTRAL(ch)) + if (OBJ_FLAGGED(obj, ITEM_ANTI_NEUTRAL) && IS_NEUTRAL(ch)) return TRUE; return FALSE; } -void equip_char(struct char_data * ch, struct obj_data * obj, int pos) +void equip_char(struct char_data *ch, struct obj_data *obj, int pos) { int j; @@ -555,7 +550,7 @@ -struct obj_data *unequip_char(struct char_data * ch, int pos) +struct obj_data *unequip_char(struct char_data *ch, int pos) { int j; struct obj_data *obj; @@ -617,7 +612,7 @@ /* Search a given list for an object number, and return a ptr to that obj */ -struct obj_data *get_obj_in_list_num(int num, struct obj_data * list) +struct obj_data *get_obj_in_list_num(int num, struct obj_data *list) { struct obj_data *i; @@ -683,7 +678,7 @@ /* put an object in a room */ -void obj_to_room(struct obj_data * object, room_rnum room) +void obj_to_room(struct obj_data *object, room_rnum room) { if (!object || room < 0 || room > top_of_world) log("SYSERR: Illegal value(s) passed to obj_to_room. (Room #%d/%d, obj %p)", @@ -700,7 +695,7 @@ /* Take an object from a room */ -void obj_from_room(struct obj_data * object) +void obj_from_room(struct obj_data *object) { struct obj_data *temp; @@ -720,7 +715,7 @@ /* put an object in an object (quaint) */ -void obj_to_obj(struct obj_data * obj, struct obj_data * obj_to) +void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to) { struct obj_data *tmp_obj; @@ -745,7 +740,7 @@ /* remove an object from an object */ -void obj_from_obj(struct obj_data * obj) +void obj_from_obj(struct obj_data *obj) { struct obj_data *temp, *obj_from; @@ -771,7 +766,7 @@ /* Set all carried_by to point to new owner */ -void object_list_new_owner(struct obj_data * list, struct char_data * ch) +void object_list_new_owner(struct obj_data *list, struct char_data *ch) { if (list) { object_list_new_owner(list->contains, ch); @@ -782,7 +777,7 @@ /* Extract an object from the world */ -void extract_obj(struct obj_data * obj) +void extract_obj(struct obj_data *obj) { struct obj_data *temp; @@ -809,7 +804,7 @@ -void update_object(struct obj_data * obj, int use) +void update_object(struct obj_data *obj, int use) { if (GET_OBJ_TIMER(obj) > 0) GET_OBJ_TIMER(obj) -= use; @@ -820,7 +815,7 @@ } -void update_char_objects(struct char_data * ch) +void update_char_objects(struct char_data *ch) { int i; @@ -929,12 +924,13 @@ if (FIGHTING(k) == ch) stop_fighting(k); } + /* we can't forget the hunters either... */ + for (temp = character_list; temp; temp = temp->next) + if (HUNTING(temp) == ch) + HUNTING(temp) = NULL; char_from_room(ch); - /* pull the char from the list */ - REMOVE_FROM_LIST(ch, character_list, next); - if (IS_NPC(ch)) { if (GET_MOB_RNUM(ch) >= 0) /* prototyped */ mob_index[GET_MOB_RNUM(ch)].number--; @@ -979,26 +975,36 @@ * Ideally it would be its own list, but that * would change the '->next' pointer, potentially * confusing some code. Ugh. -gg 3/15/2001 + * + * NOTE: This doesn't handle recursive extractions. */ void extract_pending_chars(void) { - struct char_data *vict, *next_vict; + struct char_data *vict, *next_vict, *prev_vict; if (extractions_pending < 0) log("SYSERR: Negative (%d) extractions pending.", extractions_pending); - for (vict = character_list; vict && extractions_pending; vict = next_vict) { + for (vict = character_list, prev_vict = NULL; vict && extractions_pending; vict = next_vict) { next_vict = vict->next; if (MOB_FLAGGED(vict, MOB_NOTDEADYET)) REMOVE_BIT(MOB_FLAGS(vict), MOB_NOTDEADYET); else if (PLR_FLAGGED(vict, PLR_NOTDEADYET)) REMOVE_BIT(PLR_FLAGS(vict), PLR_NOTDEADYET); - else + else { + /* Last non-free'd character to continue chain from. */ + prev_vict = vict; continue; + } extract_char_final(vict); extractions_pending--; + + if (prev_vict) + prev_vict->next = next_vict; + else + character_list = next_vict; } if (extractions_pending > 0) @@ -1014,7 +1020,7 @@ *********************************************************************** */ -struct char_data *get_player_vis(struct char_data * ch, char *name, int *number, int inroom) +struct char_data *get_player_vis(struct char_data *ch, char *name, int *number, int inroom) { struct char_data *i; int num; @@ -1070,7 +1076,7 @@ } -struct char_data *get_char_world_vis(struct char_data * ch, char *name, int *number) +struct char_data *get_char_world_vis(struct char_data *ch, char *name, int *number) { struct char_data *i; int num; @@ -1102,7 +1108,7 @@ } -struct char_data *get_char_vis(struct char_data * ch, char *name, int *number, int where) +struct char_data *get_char_vis(struct char_data *ch, char *name, int *number, int where) { if (where == FIND_CHAR_ROOM) return get_char_room_vis(ch, name, number); @@ -1113,7 +1119,7 @@ } -struct obj_data *get_obj_in_list_vis(struct char_data * ch, char *name, int *number, struct obj_data * list) +struct obj_data *get_obj_in_list_vis(struct char_data *ch, char *name, int *number, struct obj_data *list) { struct obj_data *i; int num; @@ -1137,7 +1143,7 @@ /* search the entire world for an object, and return a pointer */ -struct obj_data *get_obj_vis(struct char_data * ch, char *name, int *number) +struct obj_data *get_obj_vis(struct char_data *ch, char *name, int *number) { struct obj_data *i; int num; @@ -1169,19 +1175,48 @@ } -/* Hm, number deficient... */ -struct obj_data *get_object_in_equip_vis(struct char_data * ch, char *arg, struct obj_data *equipment[], int *j) +struct obj_data *get_obj_in_equip_vis(struct char_data *ch, char *arg, int *number, struct obj_data *equipment[]) { - for ((*j) = 0; (*j) < NUM_WEARS; (*j)++) - if (equipment[(*j)]) - if (CAN_SEE_OBJ(ch, equipment[(*j)])) - if (isname(arg, equipment[(*j)]->name)) - return (equipment[(*j)]); + int j, num; + if (!number) { + number = # + num = get_number(&arg); + } + + if (*number == 0) + return (NULL); + + for (j = 0; j < NUM_WEARS; j++) + if (equipment[j] && CAN_SEE_OBJ(ch, equipment[j]) && isname(arg, equipment[j]->name)) + if (--(*number) == 0) + return (equipment[j]); + return (NULL); } +int get_obj_pos_in_equip_vis(struct char_data *ch, char *arg, int *number, struct obj_data *equipment[]) +{ + int j, num; + + if (!number) { + number = # + num = get_number(&arg); + } + + if (*number == 0) + return (-1); + + for (j = 0; j < NUM_WEARS; j++) + if (equipment[j] && CAN_SEE_OBJ(ch, equipment[j]) && isname(arg, equipment[j]->name)) + if (--(*number) == 0) + return (j); + + return (-1); +} + + const char *money_desc(int amount) { int cnt; @@ -1291,11 +1326,11 @@ * like the one_argument routine), but now it returns an integer that * describes what it filled in. */ -int generic_find(char *arg, bitvector_t bitvector, struct char_data * ch, - struct char_data ** tar_ch, struct obj_data ** tar_obj) +int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch, + struct char_data **tar_ch, struct obj_data **tar_obj) { int i, found, number; - char name_val[256]; + char name_val[MAX_INPUT_LENGTH]; char *name = name_val; *tar_ch = NULL; Index: circle/src/handler.h diff -u circle/src/handler.h:1.11 circle/src/handler.h:1.12 --- circle/src/handler.h:1.11 Sun Mar 18 18:58:58 2001 +++ circle/src/handler.h Wed May 23 20:34:03 2001 @@ -50,12 +50,13 @@ /* ******* characters ********* */ -struct char_data *get_char_room(char *name, int *number, room_rnum room); +struct char_data *get_char_room(char *name, int *num, room_rnum room); struct char_data *get_char_num(mob_rnum nr); void char_from_room(struct char_data *ch); void char_to_room(struct char_data *ch, room_rnum room); void extract_char(struct char_data *ch); +void extract_char_final(struct char_data *ch); void extract_pending_chars(void); /* find if character can see */ @@ -65,8 +66,9 @@ struct char_data *get_char_world_vis(struct char_data *ch, char *name, int *number); struct obj_data *get_obj_in_list_vis(struct char_data *ch, char *name, int *number, struct obj_data *list); -struct obj_data *get_obj_vis(struct char_data *ch, char *name, int *number); -struct obj_data *get_object_in_equip_vis(struct char_data *ch, char *arg, struct obj_data *equipment[], int *j); +struct obj_data *get_obj_vis(struct char_data *ch, char *name, int *num); +struct obj_data *get_obj_in_equip_vis(struct char_data *ch, char *arg, int *number, struct obj_data *equipment[]); +int get_obj_pos_in_equip_vis(struct char_data *ch, char *arg, int *num, struct obj_data *equipment[]); /* find all dots */ Index: circle/src/house.c diff -u circle/src/house.c:1.23 circle/src/house.c:1.25 --- circle/src/house.c:1.23 Sun Jan 23 12:15:00 2000 +++ circle/src/house.c Thu Jun 28 08:03:53 2001 @@ -20,28 +20,26 @@ #include "house.h" #include "constants.h" -extern struct room_data *world; -extern struct index_data *obj_index; - - +/* external functions */ struct obj_data *Obj_from_store(struct obj_file_elem object, int *location); -int Obj_to_store(struct obj_data * obj, FILE * fl, int location); +int Obj_to_store(struct obj_data *obj, FILE *fl, int location); +/* local globals */ struct house_control_rec house_control[MAX_HOUSES]; int num_of_houses = 0; /* local functions */ int House_get_filename(int vnum, char *filename); int House_load(room_vnum vnum); -int House_save(struct obj_data * obj, FILE * fp); -void House_restore_weight(struct obj_data * obj); +int House_save(struct obj_data *obj, FILE *fp); +void House_restore_weight(struct obj_data *obj); void House_delete_file(int vnum); int find_house(room_vnum vnum); void House_save_control(void); -void hcontrol_list_houses(struct char_data * ch); -void hcontrol_build_house(struct char_data * ch, char *arg); -void hcontrol_destroy_house(struct char_data * ch, char *arg); -void hcontrol_pay_house(struct char_data * ch, char *arg); +void hcontrol_list_houses(struct char_data *ch); +void hcontrol_build_house(struct char_data *ch, char *arg); +void hcontrol_destroy_house(struct char_data *ch, char *arg); +void hcontrol_pay_house(struct char_data *ch, char *arg); ACMD(do_hcontrol); ACMD(do_house); @@ -93,7 +91,7 @@ /* Save all objects for a house (recursive; initial call must be followed by a call to House_restore_weight) Assumes file is open already. */ -int House_save(struct obj_data * obj, FILE * fp) +int House_save(struct obj_data *obj, FILE *fp) { struct obj_data *tmp; int result; @@ -113,7 +111,7 @@ /* restore weight of containers after House_save has changed them for saving */ -void House_restore_weight(struct obj_data * obj) +void House_restore_weight(struct obj_data *obj) { if (obj) { House_restore_weight(obj->contains); @@ -169,7 +167,7 @@ /* List all objects in a house file */ -void House_listrent(struct char_data * ch, room_vnum vnum) +void House_listrent(struct char_data *ch, room_vnum vnum) { FILE *fl; char fname[MAX_STRING_LENGTH]; @@ -302,7 +300,7 @@ " hcontrol pay \r\n" " hcontrol show\r\n"; -void hcontrol_list_houses(struct char_data * ch) +void hcontrol_list_houses(struct char_data *ch) { int i; char *timestr, *temp; @@ -349,7 +347,7 @@ -void hcontrol_build_house(struct char_data * ch, char *arg) +void hcontrol_build_house(struct char_data *ch, char *arg) { char arg1[MAX_INPUT_LENGTH]; struct house_control_rec temp_house; @@ -438,7 +436,7 @@ -void hcontrol_destroy_house(struct char_data * ch, char *arg) +void hcontrol_destroy_house(struct char_data *ch, char *arg) { int i, j; room_rnum real_atrium, real_house; @@ -484,7 +482,7 @@ } -void hcontrol_pay_house(struct char_data * ch, char *arg) +void hcontrol_pay_house(struct char_data *ch, char *arg) { int i; @@ -582,7 +580,7 @@ /* note: arg passed must be house vnum, so there. */ -int House_can_enter(struct char_data * ch, room_vnum house) +int House_can_enter(struct char_data *ch, room_vnum house) { int i, j; Index: circle/src/htmlh-head diff -u /dev/null circle/src/htmlh-head:1.1 --- /dev/null Tue Aug 14 21:55:16 2001 +++ circle/src/htmlh-head Tue May 8 11:35:49 2001 @@ -0,0 +1,4 @@ + + +
+
Index: circle/src/htmlh-tail
diff -u /dev/null circle/src/htmlh-tail:1.1
--- /dev/null	Tue Aug 14 21:55:16 2001
+++ circle/src/htmlh-tail	Tue May  8 11:35:49 2001
@@ -0,0 +1,3 @@
+
+ + Index: circle/src/interpreter.c diff -u circle/src/interpreter.c:1.25 circle/src/interpreter.c:1.28 --- circle/src/interpreter.c:1.25 Thu Jan 25 15:29:58 2001 +++ circle/src/interpreter.c Fri May 18 09:23:42 2001 @@ -24,6 +24,7 @@ #include "screen.h" +/* external variables */ extern room_rnum r_mortal_start_room; extern room_rnum r_immort_start_room; extern room_rnum r_frozen_start_room; @@ -34,16 +35,11 @@ extern char *MENU; extern char *WELC_MESSG; extern char *START_MESSG; -extern struct char_data *character_list; -extern struct descriptor_data *descriptor_list; extern struct player_index_element *player_table; extern int top_of_p_table; extern int circle_restrict; extern int no_specials; extern int max_bad_pws; -extern struct index_data *mob_index; -extern struct index_data *obj_index; -extern struct room_data *world; /* external functions */ void echo_on(struct descriptor_data *d); @@ -113,7 +109,6 @@ ACMD(do_hide); ACMD(do_hit); ACMD(do_house); -ACMD(do_info); ACMD(do_insult); ACMD(do_inventory); ACMD(do_invis); @@ -126,7 +121,6 @@ ACMD(do_look); /* ACMD(do_move); -- interpreter.h */ ACMD(do_not_here); -ACMD(do_offer); ACMD(do_olc); ACMD(do_order); ACMD(do_page); @@ -842,7 +836,7 @@ */ int search_block(char *arg, const char **list, int exact) { - register int i, l; + int i, l; /* We used to have \r as the first character on certain array items to * prevent the explicit choice of that point. It seems a bit silly to @@ -1081,8 +1075,8 @@ int special(struct char_data *ch, int cmd, char *arg) { - register struct obj_data *i; - register struct char_data *k; + struct obj_data *i; + struct char_data *k; int j; /* special in room? */ Index: circle/src/interpreter.h diff -u circle/src/interpreter.h:1.7 circle/src/interpreter.h:1.8 --- circle/src/interpreter.h:1.7 Sun May 9 21:56:41 1999 +++ circle/src/interpreter.h Thu Jun 28 08:03:53 2001 @@ -41,7 +41,7 @@ const char *command; byte minimum_position; void (*command_pointer) - (struct char_data *ch, char * argument, int cmd, int subcmd); + (struct char_data *ch, char *argument, int cmd, int subcmd); sh_int minimum_level; int subcmd; }; Index: circle/src/limits.c diff -u circle/src/limits.c:1.18 circle/src/limits.c:1.20 --- circle/src/limits.c:1.18 Mon Aug 9 15:03:37 1999 +++ circle/src/limits.c Thu Jun 28 08:03:53 2001 @@ -19,9 +19,8 @@ #include "handler.h" #include "interpreter.h" -extern struct char_data *character_list; -extern struct obj_data *object_list; -extern struct room_data *world; + +/* external variables */ extern int max_exp_gain; extern int max_exp_loss; extern int idle_rent_time; @@ -33,13 +32,13 @@ /* local functions */ int graf(int age, int p0, int p1, int p2, int p3, int p4, int p5, int p6); -void check_autowiz(struct char_data * ch); +void check_autowiz(struct char_data *ch); void Crash_rentsave(struct char_data *ch, int cost); int level_exp(int chclass, int level); char *title_male(int chclass, int level); char *title_female(int chclass, int level); -void update_char_objects(struct char_data * ch); /* handler.c */ +void update_char_objects(struct char_data *ch); /* handler.c */ void reboot_wizlists(void); /* When age < 15 return the value p0 */ @@ -76,7 +75,7 @@ */ /* manapoint gain pr. game hour */ -int mana_gain(struct char_data * ch) +int mana_gain(struct char_data *ch) { int gain; @@ -118,7 +117,7 @@ /* Hitpoint gain pr. game hour */ -int hit_gain(struct char_data * ch) +int hit_gain(struct char_data *ch) { int gain; @@ -163,7 +162,7 @@ /* move gain pr. game hour */ -int move_gain(struct char_data * ch) +int move_gain(struct char_data *ch) { int gain; @@ -203,7 +202,7 @@ -void set_title(struct char_data * ch, char *title) +void set_title(struct char_data *ch, char *title) { if (title == NULL) { if (GET_SEX(ch) == SEX_FEMALE) @@ -222,7 +221,7 @@ } -void check_autowiz(struct char_data * ch) +void check_autowiz(struct char_data *ch) { #if defined(CIRCLE_UNIX) || defined(CIRCLE_WINDOWS) if (use_autowiz && GET_LEVEL(ch) >= LVL_IMMORT) { @@ -245,7 +244,7 @@ -void gain_exp(struct char_data * ch, int gain) +void gain_exp(struct char_data *ch, int gain) { int is_altered = FALSE; int num_levels = 0; @@ -292,7 +291,7 @@ } -void gain_exp_regardless(struct char_data * ch, int gain) +void gain_exp_regardless(struct char_data *ch, int gain) { int is_altered = FALSE; int num_levels = 0; @@ -328,7 +327,7 @@ } -void gain_condition(struct char_data * ch, int condition, int value) +void gain_condition(struct char_data *ch, int condition, int value) { bool intoxicated; @@ -363,7 +362,7 @@ } -void check_idling(struct char_data * ch) +void check_idling(struct char_data *ch) { if (++(ch->char_specials.timer) > idle_void) { if (GET_WAS_IN(ch) == NOWHERE && ch->in_room != NOWHERE) { Index: circle/src/magic.c diff -u circle/src/magic.c:1.24 circle/src/magic.c:1.29 --- circle/src/magic.c:1.24 Thu Jan 25 16:36:18 2001 +++ circle/src/magic.c Thu Jun 28 08:03:53 2001 @@ -21,27 +21,22 @@ #include "interpreter.h" #include "constants.h" -extern struct room_data *world; -extern struct obj_data *object_list; -extern struct char_data *character_list; -extern struct index_data *obj_index; -extern struct descriptor_data *descriptor_list; -extern struct zone_data *zone_table; - +/* external variables */ extern int mini_mud; extern int pk_allowed; +extern struct spell_info_type spell_info[]; +/* external functions */ byte saving_throws(int class_num, int type, int level); /* class.c */ -void clearMemory(struct char_data * ch); -void weight_change_object(struct obj_data * obj, int weight); -void add_follower(struct char_data * ch, struct char_data * leader); -extern struct spell_info_type spell_info[]; +void clearMemory(struct char_data *ch); +void weight_change_object(struct obj_data *obj, int weight); +void add_follower(struct char_data *ch, struct char_data *leader); /* local functions */ -int mag_materials(struct char_data * ch, int item0, int item1, int item2, int extract, int verbose); -void perform_mag_groups(int level, struct char_data * ch, struct char_data * tch, int spellnum, int savetype); -int mag_savingthrow(struct char_data * ch, int type, int modifier); +int mag_materials(struct char_data *ch, int item0, int item1, int item2, int extract, int verbose); +void perform_mag_groups(int level, struct char_data *ch, struct char_data *tch, int spellnum, int savetype); +int mag_savingthrow(struct char_data *ch, int type, int modifier); void affect_update(void); /* @@ -56,7 +51,7 @@ * saving throw instead of the random number of the character as * in some other systems. */ -int mag_savingthrow(struct char_data * ch, int type, int modifier) +int mag_savingthrow(struct char_data *ch, int type, int modifier) { /* NPCs use warrior tables according to some book */ int class_sav = CLASS_WARRIOR; @@ -113,7 +108,7 @@ * it to implement your own spells which require ingredients (i.e., some * heal spell which requires a rare herb or some such.) */ -int mag_materials(struct char_data * ch, int item0, int item1, int item2, +int mag_materials(struct char_data *ch, int item0, int item1, int item2, int extract, int verbose) { struct obj_data *tobj; @@ -172,7 +167,7 @@ * * -1 = dead, otherwise the amount of damage done. */ -int mag_damage(int level, struct char_data * ch, struct char_data * victim, +int mag_damage(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype) { int dam = 0; @@ -281,11 +276,11 @@ * not, etc. * * affect_join(vict, aff, add_dur, avg_dur, add_mod, avg_mod) -*/ + */ #define MAX_SPELL_AFFECTS 5 /* change if more needed */ -void mag_affects(int level, struct char_data * ch, struct char_data * victim, +void mag_affects(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype) { struct affected_type af[MAX_SPELL_AFFECTS]; @@ -533,9 +528,8 @@ * This function is used to provide services to mag_groups. This function * is the one you should change to add new group spells. */ - -void perform_mag_groups(int level, struct char_data * ch, - struct char_data * tch, int spellnum, int savetype) +void perform_mag_groups(int level, struct char_data *ch, + struct char_data *tch, int spellnum, int savetype) { switch (spellnum) { case SPELL_GROUP_HEAL: @@ -562,8 +556,7 @@ * To add new group spells, you shouldn't have to change anything in * mag_groups -- just add a new case to perform_mag_groups. */ - -void mag_groups(int level, struct char_data * ch, int spellnum, int savetype) +void mag_groups(int level, struct char_data *ch, int spellnum, int savetype) { struct char_data *tch, *k; struct follow_type *f, *f_next; @@ -600,8 +593,7 @@ * * No spells of this class currently implemented as of Circle 3.0. */ - -void mag_masses(int level, struct char_data * ch, int spellnum, int savetype) +void mag_masses(int level, struct char_data *ch, int spellnum, int savetype) { struct char_data *tch, *tch_next; @@ -623,9 +615,8 @@ * in order for them to work. * * area spells have limited targets within the room. -*/ - -void mag_areas(int level, struct char_data * ch, int spellnum, int savetype) + */ +void mag_areas(int level, struct char_data *ch, int spellnum, int savetype) { struct char_data *tch, *next_tch; const char *to_char = NULL, *to_room = NULL; @@ -733,7 +724,7 @@ #define MOB_AERIALSERVANT 19 -void mag_summons(int level, struct char_data * ch, struct obj_data * obj, +void mag_summons(int level, struct char_data *ch, struct obj_data *obj, int spellnum, int savetype) { struct char_data *mob = NULL; @@ -803,35 +794,35 @@ } -void mag_points(int level, struct char_data * ch, struct char_data * victim, +void mag_points(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype) { - int hit = 0, move = 0; + int healing = 0, move = 0; if (victim == NULL) return; switch (spellnum) { case SPELL_CURE_LIGHT: - hit = dice(1, 8) + 1 + (level / 4); + healing = dice(1, 8) + 1 + (level / 4); send_to_char("You feel better.\r\n", victim); break; case SPELL_CURE_CRITIC: - hit = dice(3, 8) + 3 + (level / 4); + healing = dice(3, 8) + 3 + (level / 4); send_to_char("You feel a lot better!\r\n", victim); break; case SPELL_HEAL: - hit = 100 + dice(3, 8); + healing = 100 + dice(3, 8); send_to_char("A warm feeling floods your body.\r\n", victim); break; } - GET_HIT(victim) = MIN(GET_MAX_HIT(victim), GET_HIT(victim) + hit); + GET_HIT(victim) = MIN(GET_MAX_HIT(victim), GET_HIT(victim) + healing); GET_MOVE(victim) = MIN(GET_MAX_MOVE(victim), GET_MOVE(victim) + move); update_pos(victim); } -void mag_unaffects(int level, struct char_data * ch, struct char_data * victim, +void mag_unaffects(int level, struct char_data *ch, struct char_data *victim, int spellnum, int type) { int spell = 0; @@ -876,7 +867,7 @@ } -void mag_alter_objs(int level, struct char_data * ch, struct obj_data * obj, +void mag_alter_objs(int level, struct char_data *ch, struct obj_data *obj, int spellnum, int savetype) { const char *to_char = NULL, *to_room = NULL; @@ -886,14 +877,14 @@ switch (spellnum) { case SPELL_BLESS: - if (!IS_OBJ_STAT(obj, ITEM_BLESS) && + if (!OBJ_FLAGGED(obj, ITEM_BLESS) && (GET_OBJ_WEIGHT(obj) <= 5 * GET_LEVEL(ch))) { SET_BIT(GET_OBJ_EXTRA(obj), ITEM_BLESS); to_char = "$p glows briefly."; } break; case SPELL_CURSE: - if (!IS_OBJ_STAT(obj, ITEM_NODROP)) { + if (!OBJ_FLAGGED(obj, ITEM_NODROP)) { SET_BIT(GET_OBJ_EXTRA(obj), ITEM_NODROP); if (GET_OBJ_TYPE(obj) == ITEM_WEAPON) GET_OBJ_VAL(obj, 2)--; @@ -901,7 +892,7 @@ } break; case SPELL_INVISIBLE: - if (!IS_OBJ_STAT(obj, ITEM_NOINVIS | ITEM_INVISIBLE)) { + if (!OBJ_FLAGGED(obj, ITEM_NOINVIS | ITEM_INVISIBLE)) { SET_BIT(obj->obj_flags.extra_flags, ITEM_INVISIBLE); to_char = "$p vanishes."; } @@ -915,7 +906,7 @@ } break; case SPELL_REMOVE_CURSE: - if (IS_OBJ_STAT(obj, ITEM_NODROP)) { + if (OBJ_FLAGGED(obj, ITEM_NODROP)) { REMOVE_BIT(obj->obj_flags.extra_flags, ITEM_NODROP); if (GET_OBJ_TYPE(obj) == ITEM_WEAPON) GET_OBJ_VAL(obj, 2)++; @@ -946,7 +937,7 @@ -void mag_creations(int level, struct char_data * ch, int spellnum) +void mag_creations(int level, struct char_data *ch, int spellnum) { struct obj_data *tobj; obj_vnum z; Index: circle/src/mail.c diff -u circle/src/mail.c:1.10 circle/src/mail.c:1.15 --- circle/src/mail.c:1.10 Wed Jul 14 06:36:50 1999 +++ circle/src/mail.c Thu Jun 28 10:29:12 2001 @@ -25,19 +25,20 @@ #include "handler.h" #include "mail.h" -void postmaster_send_mail(struct char_data * ch, struct char_data *mailman, - int cmd, char *arg); -void postmaster_check_mail(struct char_data * ch, struct char_data *mailman, - int cmd, char *arg); -void postmaster_receive_mail(struct char_data * ch, struct char_data *mailman, - int cmd, char *arg); -SPECIAL(postmaster); -extern struct room_data *world; -extern struct index_data *mob_index; +/* external variables */ extern int no_mail; + +/* external functions */ +SPECIAL(postmaster); + +/* local functions */ int find_name(char *name); +void postmaster_send_mail(struct char_data *ch, struct char_data *mailman, int cmd, char *arg); +void postmaster_check_mail(struct char_data *ch, struct char_data *mailman, int cmd, char *arg); +void postmaster_receive_mail(struct char_data *ch, struct char_data *mailman, int cmd, char *arg); +/* local globals */ mail_index_type *mail_index = NULL; /* list of recs in the mail file */ position_list_type *free_list = NULL; /* list of free positions in file */ long file_end_pos = 0; /* length of file */ @@ -52,6 +53,25 @@ /* -------------------------------------------------------------------------- */ +int mail_recip_ok(char *name) +{ + struct char_file_u tmp_store; + struct char_data *victim; + int ret = 0; + + CREATE(victim, struct char_data, 1); + clear_char(victim); + if (load_char(name, &tmp_store) >= 0) { + store_to_char(&tmp_store, victim); + char_to_room(victim, 0); + if (!PLR_FLAGGED(victim, PLR_DELETED)) + ret = 1; + extract_char_final(victim); + } else + free(victim); + return ret; +} + /* * void push_free_list(long #1) * #1 - What byte offset into the file the block resides. @@ -224,7 +244,7 @@ header_block_type next_block; int total_messages = 0, block_num = 0; - if (!(mail_file = fopen(MAIL_FILE, "r"))) { + if (!(mail_file = fopen(MAIL_FILE, "rb"))) { log(" Mail file non-existant... creating new file."); touch(MAIL_FILE); return (1); @@ -500,11 +520,11 @@ } -void postmaster_send_mail(struct char_data * ch, struct char_data *mailman, +void postmaster_send_mail(struct char_data *ch, struct char_data *mailman, int cmd, char *arg) { long recipient; - char buf[256], **write; + char buf[MAX_INPUT_LENGTH], **write; if (GET_LEVEL(ch) < MIN_MAIL_LEVEL) { sprintf(buf, "$n tells you, 'Sorry, you have to be level %d to send mail!'", @@ -520,12 +540,13 @@ return; } if (GET_GOLD(ch) < STAMP_PRICE) { - sprintf(buf, "$n tells you, 'A stamp costs %d coins.'\r\n" - "$n tells you, '...which I see you can't afford.'", STAMP_PRICE); + sprintf(buf, "$n tells you, 'A stamp costs %d coin%s.'\r\n" + "$n tells you, '...which I see you can't afford.'", STAMP_PRICE, + STAMP_PRICE == 1 ? "" : "s"); act(buf, FALSE, mailman, 0, ch, TO_VICT); return; } - if ((recipient = get_id_by_name(buf)) < 0) { + if ((recipient = get_id_by_name(buf)) < 0 || !mail_recip_ok(buf)) { act("$n tells you, 'No one by that name is registered here!'", FALSE, mailman, 0, ch, TO_VICT); return; @@ -545,7 +566,7 @@ } -void postmaster_check_mail(struct char_data * ch, struct char_data *mailman, +void postmaster_check_mail(struct char_data *ch, struct char_data *mailman, int cmd, char *arg) { char buf[256]; @@ -558,7 +579,7 @@ } -void postmaster_receive_mail(struct char_data * ch, struct char_data *mailman, +void postmaster_receive_mail(struct char_data *ch, struct char_data *mailman, int cmd, char *arg) { char buf[256]; Index: circle/src/mobact.c diff -u circle/src/mobact.c:1.11 circle/src/mobact.c:1.14 --- circle/src/mobact.c:1.11 Thu Jan 25 16:46:34 2001 +++ circle/src/mobact.c Thu Jun 28 08:03:53 2001 @@ -21,23 +21,22 @@ #include "spells.h" #include "constants.h" -/* external structs */ -extern struct char_data *character_list; -extern struct index_data *mob_index; -extern struct room_data *world; + +/* external globals */ extern int no_specials; +/* external functions */ ACMD(do_get); /* local functions */ void mobile_activity(void); -void clearMemory(struct char_data * ch); +void clearMemory(struct char_data *ch); #define MOB_AGGR_TO_ALIGN (MOB_AGGR_EVIL | MOB_AGGR_NEUTRAL | MOB_AGGR_GOOD) void mobile_activity(void) { - register struct char_data *ch, *next_ch, *vict; + struct char_data *ch, *next_ch, *vict; struct obj_data *obj, *best_obj; int door, found, max; memory_rec *names; @@ -149,7 +148,7 @@ /* Mob Memory Routines */ /* make ch remember victim */ -void remember(struct char_data * ch, struct char_data * victim) +void remember(struct char_data *ch, struct char_data *victim) { memory_rec *tmp; bool present = FALSE; @@ -171,7 +170,7 @@ /* make ch forget victim */ -void forget(struct char_data * ch, struct char_data * victim) +void forget(struct char_data *ch, struct char_data *victim) { memory_rec *curr, *prev = NULL; @@ -196,7 +195,7 @@ /* erase ch's memory */ -void clearMemory(struct char_data * ch) +void clearMemory(struct char_data *ch) { memory_rec *curr, *next; Index: circle/src/modify.c diff -u circle/src/modify.c:1.23 circle/src/modify.c:1.24 --- circle/src/modify.c:1.23 Thu Jan 25 16:50:43 2001 +++ circle/src/modify.c Thu Jun 28 08:10:49 2001 @@ -427,10 +427,24 @@ /* Or if we have more to show.... */ else { diff = d->showstr_vector[d->showstr_page + 1] - d->showstr_vector[d->showstr_page]; - if (diff >= MAX_STRING_LENGTH) - diff = MAX_STRING_LENGTH - 1; + if (diff > MAX_STRING_LENGTH - 3) /* 3=\r\n\0 */ + diff = MAX_STRING_LENGTH - 3; strncpy(buffer, d->showstr_vector[d->showstr_page], diff); - buffer[diff] = '\0'; + /* + * Fix for prompt overwriting last line in compact mode submitted by + * Peter Ajamian on 04/21/2001 + */ + if (buffer[diff-2] == '\r' && buffer[diff-1]=='\n') + buffer[diff] = '\0'; + else if (buffer[diff-2] == '\n' && buffer[diff-1] == '\r') + /* This is backwards. Fix it. */ + strcpy(buffer+diff-2, "\r\n"); + else if (buffer[diff-1] == '\r' || buffer[diff-1] == '\n') + /* Just one of \r\n. Overwrite it. */ + strcpy(buffer+diff-1, "\r\n"); + else + /* Tack \r\n onto the end to fix bug with prompt overwriting last line. */ + strcpy(buffer+diff, "\r\n"); send_to_char(buffer, d->character); d->showstr_page++; } Index: circle/src/objsave.c diff -u circle/src/objsave.c:1.26 circle/src/objsave.c:1.31 --- circle/src/objsave.c:1.26 Thu Jan 25 16:47:24 2001 +++ circle/src/objsave.c Thu Jun 28 08:03:53 2001 @@ -8,10 +8,6 @@ * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * ************************************************************************ */ -/* - * AutoEQ by Burkhard Knopf - */ - #include "conf.h" #include "sysdep.h" @@ -31,10 +27,7 @@ #define LOC_INVENTORY 0 #define MAX_BAG_ROWS 5 -extern struct room_data *world; -extern struct index_data *mob_index; -extern struct index_data *obj_index; -extern struct descriptor_data *descriptor_list; +/* external variables */ extern struct player_index_element *player_table; extern int top_of_p_table; extern int rent_file_timeout, crash_file_timeout; @@ -52,24 +45,24 @@ /* local functions */ void Crash_extract_norent_eq(struct char_data *ch); void auto_equip(struct char_data *ch, struct obj_data *obj, int location); -int Crash_offer_rent(struct char_data * ch, struct char_data * receptionist, int display, int factor); -int Crash_report_unrentables(struct char_data * ch, struct char_data * recep, struct obj_data * obj); -void Crash_report_rent(struct char_data * ch, struct char_data * recep, struct obj_data * obj, long *cost, long *nitems, int display, int factor); +int Crash_offer_rent(struct char_data *ch, struct char_data *receptionist, int display, int factor); +int Crash_report_unrentables(struct char_data *ch, struct char_data *recep, struct obj_data *obj); +void Crash_report_rent(struct char_data *ch, struct char_data *recep, struct obj_data *obj, long *cost, long *nitems, int display, int factor); struct obj_data *Obj_from_store(struct obj_file_elem object, int *location); -int Obj_to_store(struct obj_data * obj, FILE * fl, int location); +int Obj_to_store(struct obj_data *obj, FILE *fl, int location); void update_obj_file(void); -int Crash_write_rentcode(struct char_data * ch, FILE * fl, struct rent_info * rent); -int gen_receptionist(struct char_data * ch, struct char_data * recep, int cmd, char *arg, int mode); -int Crash_save(struct obj_data * obj, FILE * fp, int location); -void Crash_rent_deadline(struct char_data * ch, struct char_data * recep, long cost); -void Crash_restore_weight(struct obj_data * obj); -void Crash_extract_objs(struct obj_data * obj); -int Crash_is_unrentable(struct obj_data * obj); -void Crash_extract_norents(struct obj_data * obj); -void Crash_extract_expensive(struct obj_data * obj); -void Crash_calculate_rent(struct obj_data * obj, int *cost); -void Crash_rentsave(struct char_data * ch, int cost); -void Crash_cryosave(struct char_data * ch, int cost); +int Crash_write_rentcode(struct char_data *ch, FILE *fl, struct rent_info *rent); +int gen_receptionist(struct char_data *ch, struct char_data *recep, int cmd, char *arg, int mode); +int Crash_save(struct obj_data *obj, FILE *fp, int location); +void Crash_rent_deadline(struct char_data *ch, struct char_data *recep, long cost); +void Crash_restore_weight(struct obj_data *obj); +void Crash_extract_objs(struct obj_data *obj); +int Crash_is_unrentable(struct obj_data *obj); +void Crash_extract_norents(struct obj_data *obj); +void Crash_extract_expensive(struct obj_data *obj); +void Crash_calculate_rent(struct obj_data *obj, int *cost); +void Crash_rentsave(struct char_data *ch, int cost); +void Crash_cryosave(struct char_data *ch, int cost); struct obj_data *Obj_from_store(struct obj_file_elem object, int *location) @@ -102,7 +95,7 @@ -int Obj_to_store(struct obj_data * obj, FILE * fl, int location) +int Obj_to_store(struct obj_data *obj, FILE *fl, int location) { int j; struct obj_file_elem object; @@ -129,6 +122,9 @@ return (1); } +/* + * AutoEQ by Burkhard Knopf + */ void auto_equip(struct char_data *ch, struct obj_data *obj, int location) { int j; @@ -249,10 +245,11 @@ } -int Crash_delete_crashfile(struct char_data * ch) +int Crash_delete_crashfile(struct char_data *ch) { char fname[MAX_INPUT_LENGTH]; struct rent_info rent; + int numread; FILE *fl; if (!get_filename(GET_NAME(ch), fname, CRASH_FILE)) @@ -262,10 +259,12 @@ log("SYSERR: checking for crash file %s (3): %s", fname, strerror(errno)); return (0); } - if (!feof(fl)) - fread(&rent, sizeof(struct rent_info), 1, fl); + numread = fread(&rent, sizeof(struct rent_info), 1, fl); fclose(fl); + if (numread == 0) + return (0); + if (rent.rentcode == RENT_CRASH) Crash_delete_file(GET_NAME(ch)); @@ -277,6 +276,7 @@ { char fname[MAX_STRING_LENGTH], filetype[20]; struct rent_info rent; + int numread; FILE *fl; if (!get_filename(name, fname, CRASH_FILE)) @@ -290,10 +290,12 @@ log("SYSERR: OPENING OBJECT FILE %s (4): %s", fname, strerror(errno)); return (0); } - if (!feof(fl)) - fread(&rent, sizeof(struct rent_info), 1, fl); + numread = fread(&rent, sizeof(struct rent_info), 1, fl); fclose(fl); + if (numread == 0) + return (0); + if ((rent.rentcode == RENT_CRASH) || (rent.rentcode == RENT_FORCED) || (rent.rentcode == RENT_TIMEDOUT)) { if (rent.time < time(0) - (crash_file_timeout * SECS_PER_REAL_DAY)) { @@ -326,7 +328,6 @@ } - void update_obj_file(void) { int i; @@ -336,15 +337,15 @@ Crash_clean_file(player_table[i].name); } - -void Crash_listrent(struct char_data * ch, char *name) +void Crash_listrent(struct char_data *ch, char *name) { FILE *fl; char fname[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH]; struct obj_file_elem object; struct obj_data *obj; struct rent_info rent; + int numread; if (!get_filename(name, fname, CRASH_FILE)) return; @@ -354,8 +355,15 @@ return; } sprintf(buf, "%s\r\n", fname); - if (!feof(fl)) - fread(&rent, sizeof(struct rent_info), 1, fl); + numread = fread(&rent, sizeof(struct rent_info), 1, fl); + + /* Oops, can't get the data, punt. */ + if (numread == 0) { + send_to_char("Error reading rent information.\r\n", ch); + fclose(fl); + return; + } + switch (rent.rentcode) { case RENT_RENTED: strcat(buf, "Rent\r\n"); @@ -381,7 +389,7 @@ return; } if (!feof(fl)) - if (real_object(object.item_number) > -1) { + if (real_object(object.item_number) != NOTHING) { obj = read_object(object.item_number, VIRTUAL); #if USE_AUTOEQ sprintf(buf + strlen(buf), " [%5d] (%5dau) <%2d> %-20s\r\n", @@ -404,8 +412,7 @@ } - -int Crash_write_rentcode(struct char_data * ch, FILE * fl, struct rent_info * rent) +int Crash_write_rentcode(struct char_data *ch, FILE *fl, struct rent_info *rent) { if (fwrite(rent, sizeof(struct rent_info), 1, fl) < 1) { perror("SYSERR: writing rent code"); @@ -415,14 +422,13 @@ } - /* * Return values: * 0 - successful load, keep char in rent room. * 1 - load failure or load of crash items -- put char in temple. * 2 - rented equipment lost (no $) */ -int Crash_load(struct char_data * ch) +int Crash_load(struct char_data *ch) { FILE *fl; char fname[MAX_STRING_LENGTH]; @@ -630,7 +636,7 @@ -int Crash_save(struct obj_data * obj, FILE * fp, int location) +int Crash_save(struct obj_data *obj, FILE *fp, int location) { struct obj_data *tmp; int result; @@ -650,7 +656,7 @@ } -void Crash_restore_weight(struct obj_data * obj) +void Crash_restore_weight(struct obj_data *obj) { if (obj) { Crash_restore_weight(obj->contains); @@ -679,7 +685,7 @@ } } -void Crash_extract_objs(struct obj_data * obj) +void Crash_extract_objs(struct obj_data *obj) { if (obj) { Crash_extract_objs(obj->contains); @@ -689,12 +695,12 @@ } -int Crash_is_unrentable(struct obj_data * obj) +int Crash_is_unrentable(struct obj_data *obj) { if (!obj) return (0); - if (IS_OBJ_STAT(obj, ITEM_NORENT) || GET_OBJ_RENT(obj) < 0 || + if (OBJ_FLAGGED(obj, ITEM_NORENT) || GET_OBJ_RENT(obj) < 0 || GET_OBJ_RNUM(obj) <= NOTHING || GET_OBJ_TYPE(obj) == ITEM_KEY) return (1); @@ -702,7 +708,7 @@ } -void Crash_extract_norents(struct obj_data * obj) +void Crash_extract_norents(struct obj_data *obj) { if (obj) { Crash_extract_norents(obj->contains); @@ -713,7 +719,7 @@ } -void Crash_extract_expensive(struct obj_data * obj) +void Crash_extract_expensive(struct obj_data *obj) { struct obj_data *tobj, *max; @@ -726,7 +732,7 @@ -void Crash_calculate_rent(struct obj_data * obj, int *cost) +void Crash_calculate_rent(struct obj_data *obj, int *cost) { if (obj) { *cost += MAX(0, GET_OBJ_RENT(obj)); @@ -736,7 +742,7 @@ } -void Crash_crashsave(struct char_data * ch) +void Crash_crashsave(struct char_data *ch) { char buf[MAX_INPUT_LENGTH]; struct rent_info rent; @@ -778,7 +784,7 @@ } -void Crash_idlesave(struct char_data * ch) +void Crash_idlesave(struct char_data *ch) { char buf[MAX_INPUT_LENGTH]; struct rent_info rent; @@ -840,7 +846,7 @@ } for (j = 0; j < NUM_WEARS; j++) { if (GET_EQ(ch, j)) { - if (!Crash_save(ch->carrying, fp, j + 1)) { + if (!Crash_save(GET_EQ(ch, j), fp, j + 1)) { fclose(fp); return; } @@ -858,7 +864,7 @@ } -void Crash_rentsave(struct char_data * ch, int cost) +void Crash_rentsave(struct char_data *ch, int cost) { char buf[MAX_INPUT_LENGTH]; struct rent_info rent; @@ -904,7 +910,7 @@ } -void Crash_cryosave(struct char_data * ch, int cost) +void Crash_cryosave(struct char_data *ch, int cost) { char buf[MAX_INPUT_LENGTH]; struct rent_info rent; @@ -957,7 +963,7 @@ * Routines used for the receptionist * ************************************************************************* */ -void Crash_rent_deadline(struct char_data * ch, struct char_data * recep, +void Crash_rent_deadline(struct char_data *ch, struct char_data *recep, long cost) { long rent_deadline; @@ -973,8 +979,8 @@ act(buf, FALSE, recep, 0, ch, TO_VICT); } -int Crash_report_unrentables(struct char_data * ch, struct char_data * recep, - struct obj_data * obj) +int Crash_report_unrentables(struct char_data *ch, struct char_data *recep, + struct obj_data *obj) { char buf[128]; int has_norents = 0; @@ -993,8 +999,8 @@ -void Crash_report_rent(struct char_data * ch, struct char_data * recep, - struct obj_data * obj, long *cost, long *nitems, int display, int factor) +void Crash_report_rent(struct char_data *ch, struct char_data *recep, + struct obj_data *obj, long *cost, long *nitems, int display, int factor) { static char buf[256]; @@ -1015,7 +1021,7 @@ -int Crash_offer_rent(struct char_data * ch, struct char_data * receptionist, +int Crash_offer_rent(struct char_data *ch, struct char_data *receptionist, int display, int factor) { char buf[MAX_INPUT_LENGTH]; @@ -1066,7 +1072,7 @@ -int gen_receptionist(struct char_data * ch, struct char_data * recep, +int gen_receptionist(struct char_data *ch, struct char_data *recep, int cmd, char *arg, int mode) { int cost; Index: circle/src/olc.c diff -u circle/src/olc.c:1.11 circle/src/olc.c:1.13 --- circle/src/olc.c:1.11 Mon Oct 5 16:03:27 1998 +++ circle/src/olc.c Thu Jun 28 08:03:53 2001 @@ -33,17 +33,14 @@ #define OLC_USAGE "Usage: olc { . | set | show | obj | mob | room} [args]\r\n" -extern struct room_data *world; -extern struct obj_data *obj_proto; -extern struct char_data *mob_proto; - +/* local globals */ struct char_data *olc_ch; /* local functions */ void olc_interpreter(void *targ, int mode, char *arg); -void olc_set_show(struct char_data * ch, int olc_mode, char *arg); +void olc_set_show(struct char_data *ch, int olc_mode, char *arg); void olc_string(char **string, size_t maxlen, char *arg); -int can_modify(struct char_data * ch, int vnum); +int can_modify(struct char_data *ch, int vnum); ACMD(do_olc); void olc_bitvector(int *bv, const char **names, char *arg); @@ -272,7 +269,7 @@ /* can_modify: determine if a particular char can modify a vnum */ -int can_modify(struct char_data * ch, int vnum) +int can_modify(struct char_data *ch, int vnum) { return (1); } @@ -359,6 +356,6 @@ send_to_char(buf2, olc_ch); } -void olc_set_show(struct char_data * ch, int olc_mode, char *arg) +void olc_set_show(struct char_data *ch, int olc_mode, char *arg) { } Index: circle/src/random.c diff -u circle/src/random.c:1.4 circle/src/random.c:1.5 --- circle/src/random.c:1.4 Wed Jul 29 07:23:15 1998 +++ circle/src/random.c Fri May 18 09:10:43 2001 @@ -75,7 +75,7 @@ unsigned long circle_random(void) { - register int lo, hi, test; + int lo, hi, test; hi = seed/q; lo = seed%q; Index: circle/src/shop.c diff -u circle/src/shop.c:1.26 circle/src/shop.c:1.30 --- circle/src/shop.c:1.26 Sun Mar 4 18:49:40 2001 +++ circle/src/shop.c Thu Jun 28 07:24:18 2001 @@ -25,11 +25,6 @@ #include "constants.h" /* External variables */ -extern struct index_data *mob_index; -extern struct index_data *obj_index; -extern struct char_data *mob_proto; -extern struct obj_data *obj_proto; -extern struct room_data *world; extern struct time_info_data time_info; /* Forward/External function declarations */ @@ -37,7 +32,7 @@ ACMD(do_action); ACMD(do_echo); ACMD(do_say); -void sort_keeper_objs(struct char_data * keeper, int shop_nr); +void sort_keeper_objs(struct char_data *keeper, int shop_nr); /* Local variables */ struct shop_data *shop_index; @@ -45,47 +40,48 @@ int cmd_say, cmd_tell, cmd_emote, cmd_slap, cmd_puke; /* local functions */ -int read_type_list(FILE * shop_f, struct shop_buy_data * list, int new_format, int max); -int read_list(FILE * shop_f, struct shop_buy_data * list, int new_format, int max, int type); -void shopping_list(char *arg, struct char_data * ch, struct char_data * keeper, int shop_nr); -void shopping_value(char *arg, struct char_data * ch, struct char_data * keeper, int shop_nr); -void shopping_sell(char *arg, struct char_data * ch, struct char_data * keeper, int shop_nr); -struct obj_data *get_selling_obj(struct char_data * ch, char *name, struct char_data * keeper, int shop_nr, int msg); -struct obj_data *slide_obj(struct obj_data * obj, struct char_data * keeper, int shop_nr); -void shopping_buy(char *arg, struct char_data * ch, struct char_data * keeper, int shop_nr); -struct obj_data *get_purchase_obj(struct char_data * ch, char *arg, struct char_data * keeper, int shop_nr, int msg); -struct obj_data *get_hash_obj_vis(struct char_data * ch, char *name, struct obj_data * list); -struct obj_data *get_slide_obj_vis(struct char_data * ch, char *name, struct obj_data * list); -void boot_the_shops(FILE * shop_f, char *filename, int rec_count); +char *read_shop_message(int mnum, room_vnum shr, FILE *shop_f, const char *why); +int read_type_list(FILE *shop_f, struct shop_buy_data *list, int new_format, int max); +int read_list(FILE *shop_f, struct shop_buy_data *list, int new_format, int max, int type); +void shopping_list(char *arg, struct char_data *ch, struct char_data *keeper, int shop_nr); +void shopping_value(char *arg, struct char_data *ch, struct char_data *keeper, int shop_nr); +void shopping_sell(char *arg, struct char_data *ch, struct char_data *keeper, int shop_nr); +struct obj_data *get_selling_obj(struct char_data *ch, char *name, struct char_data *keeper, int shop_nr, int msg); +struct obj_data *slide_obj(struct obj_data *obj, struct char_data *keeper, int shop_nr); +void shopping_buy(char *arg, struct char_data *ch, struct char_data *keeper, int shop_nr); +struct obj_data *get_purchase_obj(struct char_data *ch, char *arg, struct char_data *keeper, int shop_nr, int msg); +struct obj_data *get_hash_obj_vis(struct char_data *ch, char *name, struct obj_data *list); +struct obj_data *get_slide_obj_vis(struct char_data *ch, char *name, struct obj_data *list); +void boot_the_shops(FILE *shop_f, char *filename, int rec_count); void assign_the_shopkeepers(void); char *customer_string(int shop_nr, int detailed); -void list_all_shops(struct char_data * ch); -void handle_detailed_list(char *buf, char *buf1, struct char_data * ch); -void list_detailed_shop(struct char_data * ch, int shop_nr); -void show_shops(struct char_data * ch, char *arg); -int is_ok_char(struct char_data * keeper, struct char_data * ch, int shop_nr); -int is_open(struct char_data * keeper, int shop_nr, int msg); -int is_ok(struct char_data * keeper, struct char_data * ch, int shop_nr); -void push(struct stack_data * stack, int pushval); -int top(struct stack_data * stack); -int pop(struct stack_data * stack); -void evaluate_operation(struct stack_data * ops, struct stack_data * vals); +void list_all_shops(struct char_data *ch); +void handle_detailed_list(char *buf, char *buf1, struct char_data *ch); +void list_detailed_shop(struct char_data *ch, int shop_nr); +void show_shops(struct char_data *ch, char *arg); +int is_ok_char(struct char_data *keeper, struct char_data *ch, int shop_nr); +int is_open(struct char_data *keeper, int shop_nr, int msg); +int is_ok(struct char_data *keeper, struct char_data *ch, int shop_nr); +void push(struct stack_data *stack, int pushval); +int top(struct stack_data *stack); +int pop(struct stack_data *stack); +void evaluate_operation(struct stack_data *ops, struct stack_data *vals); int find_oper_num(char token); -int evaluate_expression(struct obj_data * obj, char *expr); -int trade_with(struct obj_data * item, int shop_nr); -int same_obj(struct obj_data * obj1, struct obj_data * obj2); -int shop_producing(struct obj_data * item, int shop_nr); +int evaluate_expression(struct obj_data *obj, char *expr); +int trade_with(struct obj_data *item, int shop_nr); +int same_obj(struct obj_data *obj1, struct obj_data *obj2); +int shop_producing(struct obj_data *item, int shop_nr); int transaction_amt(char *arg); -char *times_message(struct obj_data * obj, char *name, int num); -int buy_price(struct obj_data * obj, int shop_nr); -int sell_price(struct char_data * ch, struct obj_data * obj, int shop_nr); -char *list_object(struct obj_data * obj, int cnt, int index, int shop_nr); +char *times_message(struct obj_data *obj, char *name, int num); +int buy_price(struct obj_data *obj, int shop_nr); +int sell_price(struct char_data *ch, struct obj_data *obj, int shop_nr); +char *list_object(struct obj_data *obj, int cnt, int index, int shop_nr); int ok_shop_room(int shop_nr, int room); SPECIAL(shop_keeper); -int ok_damage_shopkeeper(struct char_data * ch, struct char_data * victim); -int add_to_list(struct shop_buy_data * list, int type, int *len, int *val); -int end_read_list(struct shop_buy_data * list, int len, int error); -void read_line(FILE * shop_f, const char *string, void *data); +int ok_damage_shopkeeper(struct char_data *ch, struct char_data *victim); +int add_to_list(struct shop_buy_data *list, int type, int *len, int *val); +int end_read_list(struct shop_buy_data *list, int len, int error); +void read_line(FILE *shop_f, const char *string, void *data); /* config arrays */ @@ -116,7 +112,7 @@ "\n" }; -int is_ok_char(struct char_data * keeper, struct char_data * ch, int shop_nr) +int is_ok_char(struct char_data *keeper, struct char_data *ch, int shop_nr) { char buf[200]; @@ -149,7 +145,7 @@ } -int is_open(struct char_data * keeper, int shop_nr, int msg) +int is_open(struct char_data *keeper, int shop_nr, int msg) { char buf[200]; @@ -170,7 +166,7 @@ } -int is_ok(struct char_data * keeper, struct char_data * ch, int shop_nr) +int is_ok(struct char_data *keeper, struct char_data *ch, int shop_nr) { if (is_open(keeper, shop_nr, TRUE)) return (is_ok_char(keeper, ch, shop_nr)); @@ -179,13 +175,13 @@ } -void push(struct stack_data * stack, int pushval) +void push(struct stack_data *stack, int pushval) { S_DATA(stack, S_LEN(stack)++) = pushval; } -int top(struct stack_data * stack) +int top(struct stack_data *stack) { if (S_LEN(stack) > 0) return (S_DATA(stack, S_LEN(stack) - 1)); @@ -194,7 +190,7 @@ } -int pop(struct stack_data * stack) +int pop(struct stack_data *stack) { if (S_LEN(stack) > 0) return (S_DATA(stack, --S_LEN(stack))); @@ -205,7 +201,7 @@ } -void evaluate_operation(struct stack_data * ops, struct stack_data * vals) +void evaluate_operation(struct stack_data *ops, struct stack_data *vals) { int oper; @@ -235,7 +231,7 @@ } -int evaluate_expression(struct obj_data * obj, char *expr) +int evaluate_expression(struct obj_data *obj, char *expr) { struct stack_data ops, vals; char *ptr, *end, name[200]; @@ -290,14 +286,14 @@ } -int trade_with(struct obj_data * item, int shop_nr) +int trade_with(struct obj_data *item, int shop_nr) { int counter; if (GET_OBJ_COST(item) < 1) return (OBJECT_NOVAL); - if (IS_OBJ_STAT(item, ITEM_NOSELL)) + if (OBJ_FLAGGED(item, ITEM_NOSELL)) return (OBJECT_NOTOK); for (counter = 0; SHOP_BUYTYPE(shop_nr, counter) != NOTHING; counter++) @@ -313,7 +309,7 @@ } -int same_obj(struct obj_data * obj1, struct obj_data * obj2) +int same_obj(struct obj_data *obj1, struct obj_data *obj2) { int index; @@ -338,7 +334,7 @@ } -int shop_producing(struct obj_data * item, int shop_nr) +int shop_producing(struct obj_data *item, int shop_nr) { int counter; @@ -372,7 +368,7 @@ } -char *times_message(struct obj_data * obj, char *name, int num) +char *times_message(struct obj_data *obj, char *name, int num) { static char buf[256]; char *ptr; @@ -393,8 +389,8 @@ } -struct obj_data *get_slide_obj_vis(struct char_data * ch, char *name, - struct obj_data * list) +struct obj_data *get_slide_obj_vis(struct char_data *ch, char *name, + struct obj_data *list) { struct obj_data *i, *last_match = 0; int j, number; @@ -418,8 +414,8 @@ } -struct obj_data *get_hash_obj_vis(struct char_data * ch, char *name, - struct obj_data * list) +struct obj_data *get_hash_obj_vis(struct char_data *ch, char *name, + struct obj_data *list) { struct obj_data *loop, *last_obj = 0; int index; @@ -442,8 +438,8 @@ } -struct obj_data *get_purchase_obj(struct char_data * ch, char *arg, - struct char_data * keeper, int shop_nr, int msg) +struct obj_data *get_purchase_obj(struct char_data *ch, char *arg, + struct char_data *keeper, int shop_nr, int msg) { char buf[MAX_STRING_LENGTH], name[MAX_INPUT_LENGTH]; struct obj_data *obj; @@ -470,14 +466,14 @@ } -int buy_price(struct obj_data * obj, int shop_nr) +int buy_price(struct obj_data *obj, int shop_nr) { return ((int) (GET_OBJ_COST(obj) * SHOP_BUYPROFIT(shop_nr))); } -void shopping_buy(char *arg, struct char_data * ch, - struct char_data * keeper, int shop_nr) +void shopping_buy(char *arg, struct char_data *ch, + struct char_data *keeper, int shop_nr) { char tempstr[200], buf[MAX_STRING_LENGTH]; struct obj_data *obj, *last_obj = NULL; @@ -587,8 +583,8 @@ } -struct obj_data *get_selling_obj(struct char_data * ch, char *name, - struct char_data * keeper, int shop_nr, int msg) +struct obj_data *get_selling_obj(struct char_data *ch, char *name, + struct char_data *keeper, int shop_nr, int msg) { char buf[MAX_STRING_LENGTH]; struct obj_data *obj; @@ -627,13 +623,13 @@ } -int sell_price(struct char_data * ch, struct obj_data * obj, int shop_nr) +int sell_price(struct char_data *ch, struct obj_data *obj, int shop_nr) { return ((int) (GET_OBJ_COST(obj) * SHOP_SELLPROFIT(shop_nr))); } -struct obj_data *slide_obj(struct obj_data * obj, struct char_data * keeper, +struct obj_data *slide_obj(struct obj_data *obj, struct char_data *keeper, int shop_nr) /* This function is a slight hack! To make sure that duplicate items are @@ -673,7 +669,7 @@ } -void sort_keeper_objs(struct char_data * keeper, int shop_nr) +void sort_keeper_objs(struct char_data *keeper, int shop_nr) { struct obj_data *list = 0, *temp; @@ -697,8 +693,8 @@ } -void shopping_sell(char *arg, struct char_data * ch, - struct char_data * keeper, int shop_nr) +void shopping_sell(char *arg, struct char_data *ch, + struct char_data *keeper, int shop_nr) { char tempstr[200], buf[MAX_STRING_LENGTH], name[MAX_INPUT_LENGTH]; struct obj_data *obj; @@ -770,8 +766,8 @@ } -void shopping_value(char *arg, struct char_data * ch, - struct char_data * keeper, int shop_nr) +void shopping_value(char *arg, struct char_data *ch, + struct char_data *keeper, int shop_nr) { char buf[MAX_STRING_LENGTH]; struct obj_data *obj; @@ -797,7 +793,7 @@ } -char *list_object(struct obj_data * obj, int cnt, int index, int shop_nr) +char *list_object(struct obj_data *obj, int cnt, int index, int shop_nr) { static char buf[256]; char buf2[300], buf3[200]; @@ -826,12 +822,13 @@ } -void shopping_list(char *arg, struct char_data * ch, - struct char_data * keeper, int shop_nr) +void shopping_list(char *arg, struct char_data *ch, + struct char_data *keeper, int shop_nr) { char buf[MAX_STRING_LENGTH], name[MAX_INPUT_LENGTH]; struct obj_data *obj, *last_obj = 0; - int cnt = 0, index = 0; + int cnt = 0, index = 0, found = 0; + /* cnt is the number of that particular object available */ if (!(is_ok(keeper, ch, shop_nr))) return; @@ -853,19 +850,21 @@ else { index++; if (!(*name) || isname(name, last_obj->name)) + { strcat(buf, list_object(last_obj, cnt, index, shop_nr)); + found = 1; + } cnt = 1; last_obj = obj; } } index++; - if (!last_obj) { - if (*name) - strcpy(buf, "Presently, none of those are for sale.\r\n"); - else - strcpy(buf, "Currently, there is nothing for sale.\r\n"); - } else if (!(*name) || isname(name, last_obj->name)) + if (!last_obj) /* we actually have nothing in our list for sale, period */ + strcpy(buf, "Currently, there is nothing for sale.\r\n"); + else if (!(*name) || isname(name, last_obj->name)) /* show last obj */ strcat(buf, list_object(last_obj, cnt, index, shop_nr)); + else if (!found) /* nothing the char was looking for was found */ + strcpy(buf, "Presently, none of those are for sale.\r\n"); page_string(ch->desc, buf, 1); } @@ -934,7 +933,7 @@ } -int ok_damage_shopkeeper(struct char_data * ch, struct char_data * victim) +int ok_damage_shopkeeper(struct char_data *ch, struct char_data *victim) { char buf[200]; int index; @@ -951,7 +950,7 @@ } -int add_to_list(struct shop_buy_data * list, int type, int *len, int *val) +int add_to_list(struct shop_buy_data *list, int type, int *len, int *val) { if (*val >= 0) { if (*len < MAX_SHOP_OBJ) { @@ -970,7 +969,7 @@ } -int end_read_list(struct shop_buy_data * list, int len, int error) +int end_read_list(struct shop_buy_data *list, int len, int error) { if (error) log("SYSERR: Raise MAX_SHOP_OBJ constant in shop.h to %d", len + error); @@ -980,7 +979,7 @@ } -void read_line(FILE * shop_f, const char *string, void *data) +void read_line(FILE *shop_f, const char *string, void *data) { if (!get_line(shop_f, buf) || !sscanf(buf, string, data)) { log("SYSERR: Error in shop #%d\n", SHOP_NUM(top_shop)); @@ -989,7 +988,7 @@ } -int read_list(FILE * shop_f, struct shop_buy_data * list, int new_format, +int read_list(FILE *shop_f, struct shop_buy_data *list, int new_format, int max, int type) { int count, temp, len = 0, error = 0; @@ -1008,7 +1007,7 @@ } -int read_type_list(FILE * shop_f, struct shop_buy_data * list, +int read_type_list(FILE *shop_f, struct shop_buy_data *list, int new_format, int max) { int index, num, len = 0, error = 0; @@ -1087,7 +1086,7 @@ } -void boot_the_shops(FILE * shop_f, char *filename, int rec_count) +void boot_the_shops(FILE *shop_f, char *filename, int rec_count) { char *buf, buf2[150]; int temp, count, new_format = 0; @@ -1200,7 +1199,7 @@ } -void list_all_shops(struct char_data * ch) +void list_all_shops(struct char_data *ch) { int shop_nr; @@ -1226,7 +1225,7 @@ } -void handle_detailed_list(char *buf, char *buf1, struct char_data * ch) +void handle_detailed_list(char *buf, char *buf1, struct char_data *ch) { if ((strlen(buf1) + strlen(buf) < 78) || (strlen(buf) < 20)) strcat(buf, buf1); @@ -1238,7 +1237,7 @@ } -void list_detailed_shop(struct char_data * ch, int shop_nr) +void list_detailed_shop(struct char_data *ch, int shop_nr) { struct obj_data *obj; struct char_data *k; @@ -1330,7 +1329,7 @@ } -void show_shops(struct char_data * ch, char *arg) +void show_shops(struct char_data *ch, char *arg) { int shop_nr; Index: circle/src/shop.h diff -u circle/src/shop.h:1.10 circle/src/shop.h:1.11 --- circle/src/shop.h:1.10 Tue Feb 16 12:42:27 1999 +++ circle/src/shop.h Fri May 18 09:31:13 2001 @@ -52,7 +52,6 @@ /* Pretty general macros that could be used elsewhere */ #define IS_GOD(ch) (!IS_NPC(ch) && (GET_LEVEL(ch) >= LVL_GOD)) -#define GET_OBJ_NUM(obj) (obj->item_number) #define END_OF(buffer) ((buffer) + strlen((buffer))) Index: circle/src/spec_assign.c diff -u circle/src/spec_assign.c:1.8 circle/src/spec_assign.c:1.9 --- circle/src/spec_assign.c:1.8 Tue Dec 14 10:02:38 1999 +++ circle/src/spec_assign.c Fri May 18 08:47:37 2001 @@ -16,12 +16,12 @@ #include "interpreter.h" #include "utils.h" + +/* external globals */ extern int dts_are_dumps; extern int mini_mud; -extern struct room_data *world; -extern struct index_data *mob_index; -extern struct index_data *obj_index; +/* external functions */ SPECIAL(dump); SPECIAL(pet_shops); SPECIAL(postmaster); Index: circle/src/spec_procs.c diff -u circle/src/spec_procs.c:1.24 circle/src/spec_procs.c:1.26 --- circle/src/spec_procs.c:1.24 Thu Jan 25 16:50:43 2001 +++ circle/src/spec_procs.c Thu Jun 28 08:03:53 2001 @@ -21,17 +21,12 @@ #include "constants.h" /* external vars */ -extern struct room_data *world; -extern struct char_data *character_list; -extern struct descriptor_data *descriptor_list; -extern struct index_data *mob_index; -extern struct index_data *obj_index; extern struct time_info_data time_info; extern struct spell_info_type spell_info[]; extern int guild_info[][3]; /* extern functions */ -void add_follower(struct char_data * ch, struct char_data * leader); +void add_follower(struct char_data *ch, struct char_data *leader); ACMD(do_drop); ACMD(do_gen_door); ACMD(do_say); @@ -40,11 +35,11 @@ void sort_spells(void); int compare_spells(const void *x, const void *y); const char *how_good(int percent); -void list_skills(struct char_data * ch); +void list_skills(struct char_data *ch); SPECIAL(guild); SPECIAL(dump); SPECIAL(mayor); -void npc_steal(struct char_data * ch, struct char_data * victim); +void npc_steal(struct char_data *ch, struct char_data *victim); SPECIAL(snake); SPECIAL(thief); SPECIAL(magic_user); @@ -124,7 +119,7 @@ #define MAXGAIN(ch) (prac_params[MAX_PER_PRAC][(int)GET_CLASS(ch)]) #define SPLSKL(ch) (prac_types[prac_params[PRAC_TYPE][(int)GET_CLASS(ch)]]) -void list_skills(struct char_data * ch) +void list_skills(struct char_data *ch) { int i, sortpos; @@ -331,7 +326,7 @@ ******************************************************************** */ -void npc_steal(struct char_data * ch, struct char_data * victim) +void npc_steal(struct char_data *ch, struct char_data *victim) { int gold; Index: circle/src/spell_parser.c diff -u circle/src/spell_parser.c:1.24 circle/src/spell_parser.c:1.27 --- circle/src/spell_parser.c:1.24 Thu Jan 25 16:36:18 2001 +++ circle/src/spell_parser.c Thu Jun 28 08:03:53 2001 @@ -21,16 +21,16 @@ #include "comm.h" #include "db.h" -struct spell_info_type spell_info[TOP_SPELL_DEFINE + 1]; #define SINFO spell_info[spellnum] -extern struct room_data *world; +/* local globals */ +struct spell_info_type spell_info[TOP_SPELL_DEFINE + 1]; /* local functions */ -void say_spell(struct char_data * ch, int spellnum, struct char_data * tch, struct obj_data * tobj); +void say_spell(struct char_data *ch, int spellnum, struct char_data *tch, struct obj_data *tobj); void spello(int spl, const char *name, int max_mana, int min_mana, int mana_change, int minpos, int targets, int violent, int routines, const char *wearoff); -int mag_manacost(struct char_data * ch, int spellnum); +int mag_manacost(struct char_data *ch, int spellnum); ACMD(do_cast); void unused_spell(int spl); void mag_assign_spells(void); @@ -85,7 +85,7 @@ const char *unused_spellname = "!UNUSED!"; /* So we can get &unused_spellname */ -int mag_manacost(struct char_data * ch, int spellnum) +int mag_manacost(struct char_data *ch, int spellnum) { return MAX(SINFO.mana_max - (SINFO.mana_change * (GET_LEVEL(ch) - SINFO.min_level[(int) GET_CLASS(ch)])), @@ -94,8 +94,8 @@ /* say_spell erodes buf, buf1, buf2 */ -void say_spell(struct char_data * ch, int spellnum, struct char_data * tch, - struct obj_data * tobj) +void say_spell(struct char_data *ch, int spellnum, struct char_data *tch, + struct obj_data *tobj) { char lbuf[256]; const char *format; @@ -204,8 +204,8 @@ * This is also the entry point for non-spoken or unrestricted spells. * Spellnum 0 is legal but silently ignored here, to make callers simpler. */ -int call_magic(struct char_data * caster, struct char_data * cvict, - struct obj_data * ovict, int spellnum, int level, int casttype) +int call_magic(struct char_data *caster, struct char_data *cvict, + struct obj_data *ovict, int spellnum, int level, int casttype) { int savetype; @@ -303,8 +303,7 @@ * the DikuMUD format did not specify staff and wand levels in the world * files (this is a CircleMUD enhancement). */ - -void mag_objectmagic(struct char_data * ch, struct obj_data * obj, +void mag_objectmagic(struct char_data *ch, struct obj_data *obj, char *argument) { int i, k; @@ -452,9 +451,8 @@ * Entry point for NPC casts. Recommended entry point for spells cast * by NPCs via specprocs. */ - -int cast_spell(struct char_data * ch, struct char_data * tch, - struct obj_data * tobj, int spellnum) +int cast_spell(struct char_data *ch, struct char_data *tch, + struct obj_data *tobj, int spellnum) { if (spellnum < 0 || spellnum > TOP_SPELL_DEFINE) { log("SYSERR: cast_spell trying to call spellnum %d/%d.\n", spellnum, @@ -511,7 +509,6 @@ * the spell can be cast, checks for sufficient mana and subtracts it, and * passes control to cast_spell(). */ - ACMD(do_cast) { struct char_data *tch = NULL; @@ -1004,7 +1001,6 @@ skillo(SKILL_HIDE, "hide"); skillo(SKILL_KICK, "kick"); skillo(SKILL_PICK_LOCK, "pick lock"); - skillo(SKILL_PUNCH, "punch"); skillo(SKILL_RESCUE, "rescue"); skillo(SKILL_SNEAK, "sneak"); skillo(SKILL_STEAL, "steal"); Index: circle/src/spells.c diff -u circle/src/spells.c:1.18 circle/src/spells.c:1.20 --- circle/src/spells.c:1.18 Mon Jul 3 03:50:25 2000 +++ circle/src/spells.c Thu Jun 28 08:03:53 2001 @@ -21,23 +21,19 @@ #include "constants.h" #include "interpreter.h" -extern room_rnum r_mortal_start_room; -extern struct room_data *world; -extern struct obj_data *object_list; -extern struct char_data *character_list; -extern struct index_data *obj_index; -extern struct descriptor_data *descriptor_list; -extern struct zone_data *zone_table; +/* external variables */ +extern room_rnum r_mortal_start_room; extern int mini_mud; extern int pk_allowed; -void clearMemory(struct char_data * ch); -void weight_change_object(struct obj_data * obj, int weight); -void add_follower(struct char_data * ch, struct char_data * leader); -int mag_savingthrow(struct char_data * ch, int type, int modifier); -void name_to_drinkcon(struct obj_data * obj, int type); -void name_from_drinkcon(struct obj_data * obj); +/* external functions */ +void clearMemory(struct char_data *ch); +void weight_change_object(struct obj_data *obj, int weight); +void add_follower(struct char_data *ch, struct char_data *leader); +int mag_savingthrow(struct char_data *ch, int type, int modifier); +void name_to_drinkcon(struct obj_data *obj, int type); +void name_from_drinkcon(struct obj_data *obj); int compute_armor_class(struct char_data *ch); /* Index: circle/src/spells.h diff -u circle/src/spells.h:1.8 circle/src/spells.h:1.9 --- circle/src/spells.h:1.8 Thu Jan 25 16:36:18 2001 +++ circle/src/spells.h Thu May 10 05:11:55 2001 @@ -96,7 +96,7 @@ #define SKILL_HIDE 133 /* Reserved Skill[] DO NOT CHANGE */ #define SKILL_KICK 134 /* Reserved Skill[] DO NOT CHANGE */ #define SKILL_PICK_LOCK 135 /* Reserved Skill[] DO NOT CHANGE */ -#define SKILL_PUNCH 136 /* Reserved Skill[] DO NOT CHANGE */ +/* Undefined 136 */ #define SKILL_RESCUE 137 /* Reserved Skill[] DO NOT CHANGE */ #define SKILL_SNEAK 138 /* Reserved Skill[] DO NOT CHANGE */ #define SKILL_STEAL 139 /* Reserved Skill[] DO NOT CHANGE */ Index: circle/src/structs.h diff -u circle/src/structs.h:1.34 circle/src/structs.h:1.37 --- circle/src/structs.h:1.34 Sun Mar 18 18:58:58 2001 +++ circle/src/structs.h Tue Aug 14 17:54:08 2001 @@ -17,7 +17,7 @@ * You are supposed to compare this with the macro CIRCLEMUD_VERSION() * in utils.h. See there for usage. */ -#define _CIRCLEMUD 0x030012 /* Major/Minor/Patchlevel - MMmmPP */ +#define _CIRCLEMUD 0x030013 /* Major/Minor/Patchlevel - MMmmPP */ /* * If you want equipment to be automatically equipped to the same place @@ -469,6 +469,7 @@ #define PULSE_IDLEPWD (15 RL_SEC) #define PULSE_SANITY (30 RL_SEC) #define PULSE_USAGE (5 * 60 RL_SEC) /* 5 mins */ +#define PULSE_TIMESAVE (30 * 60 RL_SEC) /* should be >= SECS_PER_MUD_HOUR */ /* Variables for the output buffering system */ #define MAX_SOCK_BUF (12 * 1024) /* Size of kernel's sock buf */ @@ -492,6 +493,7 @@ #define MAX_SKILLS 200 /* Used in char_file_u *DO*NOT*CHANGE* */ #define MAX_AFFECT 32 /* Used in char_file_u *DO*NOT*CHANGE* */ #define MAX_OBJ_AFFECT 6 /* Used in obj_file_elem *DO*NOT*CHANGE* */ +#define MAX_NOTE_LENGTH 1000 /* arbitrary */ /* * A MAX_PWD_LENGTH of 10 will cause BSD-derived systems with MD5 passwords Index: circle/src/utils.c diff -u circle/src/utils.c:1.28 circle/src/utils.c:1.32 --- circle/src/utils.c:1.28 Thu Jan 25 16:50:43 2001 +++ circle/src/utils.c Thu Jun 28 08:03:53 2001 @@ -21,17 +21,18 @@ #include "handler.h" #include "interpreter.h" -extern struct descriptor_data *descriptor_list; + +/* external globals */ extern struct time_data time_info; -extern struct room_data *world; /* local functions */ struct time_info_data *real_time_passed(time_t t2, time_t t1); struct time_info_data *mud_time_passed(time_t t2, time_t t1); -void die_follower(struct char_data * ch); -void add_follower(struct char_data * ch, struct char_data * leader); +void die_follower(struct char_data *ch); +void add_follower(struct char_data *ch, struct char_data *leader); void prune_crlf(char *txt); + /* creates a random number in interval [from;to] */ int number(int from, int to) { @@ -43,20 +44,31 @@ log("SYSERR: number() should be called with lowest, then highest. number(%d, %d), not number(%d, %d).", from, to, to, from); } + /* + * This should always be of the form: + * + * ((float)(from - to + 1) * rand() / (float)(RAND_MAX + from) + from); + * + * if you are using rand() due to historical non-randomness of the + * lower bits in older implementations. We always use circle_random() + * though, which shouldn't have that problem. Mean and standard + * deviation of both are identical (within the realm of statistical + * identity) if the rand() implementation is non-broken. + */ return ((circle_random() % (to - from + 1)) + from); } /* simulates dice roll */ -int dice(int number, int size) +int dice(int num, int size) { int sum = 0; - if (size <= 0 || number <= 0) + if (size <= 0 || num <= 0) return (0); - while (number-- > 0) - sum += ((circle_random() % size) + 1); + while (num-- > 0) + sum += number(1, size); return (sum); } @@ -149,7 +161,7 @@ } /* log a death trap hit */ -void log_death_trap(struct char_data * ch) +void log_death_trap(struct char_data *ch) { char buf[256]; @@ -332,8 +344,20 @@ } +time_t mud_time_to_secs(struct time_info_data *now) +{ + time_t when = 0; + + when += now->year * SECS_PER_MUD_YEAR; + when += now->month * SECS_PER_MUD_MONTH; + when += now->day * SECS_PER_MUD_DAY; + when += now->hours * SECS_PER_MUD_HOUR; + + return (time(NULL) - when); +} + -struct time_info_data *age(struct char_data * ch) +struct time_info_data *age(struct char_data *ch) { static struct time_info_data player_age; @@ -347,7 +371,7 @@ /* Check if making CH follow VICTIM will create an illegal */ /* Follow "Loop/circle" */ -bool circle_follow(struct char_data * ch, struct char_data * victim) +bool circle_follow(struct char_data *ch, struct char_data *victim) { struct char_data *k; @@ -363,7 +387,7 @@ /* Called when stop following persons, or stopping charm */ /* This will NOT do if a character quits/dies!! */ -void stop_follower(struct char_data * ch) +void stop_follower(struct char_data *ch) { struct follow_type *j, *k; @@ -403,7 +427,7 @@ /* Called when a character that follows/is followed dies */ -void die_follower(struct char_data * ch) +void die_follower(struct char_data *ch) { struct follow_type *j, *k; @@ -420,7 +444,7 @@ /* Do NOT call this before having checked if a circle of followers */ /* will arise. CH will follow leader */ -void add_follower(struct char_data * ch, struct char_data * leader) +void add_follower(struct char_data *ch, struct char_data *leader) { struct follow_type *k; @@ -450,7 +474,7 @@ * * Returns the number of lines advanced in the file. */ -int get_line(FILE * fl, char *buf) +int get_line(FILE *fl, char *buf) { char temp[256]; int lines = 0; Index: circle/src/utils.h diff -u circle/src/utils.h:1.37 circle/src/utils.h:1.41 --- circle/src/utils.h:1.37 Sat Mar 10 17:06:47 2001 +++ circle/src/utils.h Sat Jun 30 23:59:42 2001 @@ -30,6 +30,7 @@ void sprinttype(int type, const char *names[], char *result); int get_line(FILE *fl, char *buf); int get_filename(char *orig_name, char *filename, int mode); +time_t mud_time_to_secs(struct time_info_data *now); struct time_info_data *age(struct char_data *ch); int num_pc_in_room(struct room_data *room); void core_dump_real(const char *, int); @@ -54,7 +55,7 @@ char *CAP(char *txt); /* in magic.c */ -bool circle_follow(struct char_data *ch, struct char_data * victim); +bool circle_follow(struct char_data *ch, struct char_data *victim); /* in act.informative.c */ void look_at_room(struct char_data *ch, int mode); @@ -122,7 +123,6 @@ #define UPPER(c) (((c)>='a' && (c) <= 'z') ? ((c)+('A'-'a')) : (c) ) #define ISNEWL(ch) ((ch) == '\n' || (ch) == '\r') -#define IF_STR(st) ((st) ? (st) : "\0") /* See also: ANA, SANA */ #define AN(string) (strchr("aeiouAEIOU", *string) ? "an" : "a") @@ -203,7 +203,7 @@ #define ROOM_FLAGGED(loc, flag) (IS_SET(ROOM_FLAGS(loc), (flag))) #define EXIT_FLAGGED(exit, flag) (IS_SET((exit)->exit_info, (flag))) #define OBJVAL_FLAGGED(obj, flag) (IS_SET(GET_OBJ_VAL((obj), 1), (flag))) -#define OBJWEAR_FLAGGED(obj, flag) (IS_SET((obj)->obj_flags.wear_flags, (flag))) +#define OBJWEAR_FLAGGED(obj, flag) (IS_SET(GET_OBJ_WEAR(obj), (flag))) #define OBJ_FLAGGED(obj, flag) (IS_SET(GET_OBJ_EXTRA(obj), (flag))) #define HAS_SPELL_ROUTINE(spl, flag) (IS_SET(SPELL_ROUTINES(spl), (flag))) @@ -367,7 +367,6 @@ #define GET_OBJ_RNUM(obj) ((obj)->item_number) #define GET_OBJ_VNUM(obj) (GET_OBJ_RNUM(obj) >= 0 ? \ obj_index[GET_OBJ_RNUM(obj)].vnum : NOTHING) -#define IS_OBJ_STAT(obj,stat) (IS_SET((obj)->obj_flags.extra_flags,stat)) #define IS_CORPSE(obj) (GET_OBJ_TYPE(obj) == ITEM_CONTAINER && \ GET_OBJ_VAL((obj), 3) == 1) @@ -419,7 +418,7 @@ #define INVIS_OK_OBJ(sub, obj) \ - (!IS_OBJ_STAT((obj), ITEM_INVISIBLE) || AFF_FLAGGED((sub), AFF_DETECT_INVIS)) + (!OBJ_FLAGGED((obj), ITEM_INVISIBLE) || AFF_FLAGGED((sub), AFF_DETECT_INVIS)) /* Is anyone carrying this object and if so, are they visible? */ #define CAN_SEE_OBJ_CARRIER(sub, obj) \ Index: circle/src/doc/.cvsignore diff -u /dev/null circle/src/doc/.cvsignore:1.1 --- /dev/null Tue Aug 14 21:55:16 2001 +++ circle/src/doc/.cvsignore Tue May 8 11:32:35 2001 @@ -0,0 +1,63 @@ +conf.h +.accepted +Makefile +act.comm.c.html +act.informative.c.html +act.item.c.html +act.movement.c.html +act.offensive.c.html +act.other.c.html +act.social.c.html +act.wizard.c.html +alias.c.html +ban.c.html +boards.c.html +boards.h.html +castle.c.html +circle.function +circle.html +circle.include +circle.typedef +circle.variable +class.c.html +comm.c.html +comm.h.html +conf.h.html +config.c.html +constants.c.html +constants.h.html +db.c.html +db.h.html +fight.c.html +graph.c.html +handler.c.html +handler.h.html +house.c.html +house.h.html +index.html +interpreter.c.html +interpreter.h.html +limits.c.html +magic.c.html +mail.c.html +mail.h.html +mobact.c.html +modify.c.html +objsave.c.html +olc.c.html +olc.h.html +random.c.html +screen.h.html +shop.c.html +shop.h.html +spec_assign.c.html +spec_procs.c.html +spell_parser.c.html +spells.c.html +spells.h.html +structs.h.html +sysdep.h.html +telnet.h.html +utils.c.html +utils.h.html +weather.c.html