Code changelog (Syn)


  • retired

    Hey guys,
    I thought I'd start keeping detailed changelogs, since there are more of us coding. Hopefully this documentation habit will rub off on the newer coders 8).

    A brief categorization, line number(s), and description of the fix/change/addition should do.
    Here's my first round.
    [code] 10/29/06 * Fix: mob_cmds.c, lines 275-278 Added an ifcheck to make sure that PCs don't execute "mob" commands. This causes segfaults with things like mob delay, and any mpcommands that reference the pIndexData. 10/28/06 * Fix: olc.c, lines 2660, 2598, 2661 Added "nocolor" filter so that the objects, mobs and rooms with color in the name would line up right in the olist/mlist/rlist. 10/27/06 * Fix: hunt.c, line 513 Commented out a redundant ifcheck in the trackless step routine. The ifcheck check whether or not the huntee was a ranger before going on, thus causing a segfault for NPCs who have the skill. * Commented out: comm.c, line 2344-2353 Commented out some ifchecks that were incorrect and prevented new players from seeing prompt and having nosummon on. * Addition/Fix: act_obj.c, line 4642 Added an ifcheck to prevent mortals from stealing from immortals. * Fix: shoot.c, line 629-630 Cleaned up some code (removed debugging), and added an ifcheck so the pcdata of NPCs wouldn't b checked. * Fix: fight.c, line 4196 Fixed it so NPCs could intimidate. * Fix: fight.c, line 281 Removed IS_NPC from the ifcheck on account of giving all mobs a movement value. * Fix: fight.c, line 4941 Same fix for dirt kick as bash. * Fix: fight.c, line 4282 Fixed the get skill if-check so that mobs could bash, too. * Fix: act_info.c, line 1796 Inserted an if-check to make sure that the mob is a PC before trying to check its pcdata. Has to do with sith sense danger skill. * Fix: handler.c, line 479 Fixed the get_skill function to return reasonable values for NPC skills, scaling as 40+19 log(level). This will do to at least enable many skills for NPCs for now until we establish a more specific way of assigning skills to NPCs. The range is from 40% at level 1 to 91% or so at level 500. 10/24/2006 * Fix: mob_cmds.c, line 3112 The "obj remove" function (opremove) was referring to obj->next_content instead of obj1->next_content when looping through the list in the person's inv, causing an infinite loop (obj1 is the temporary variable used to cycle through the list). 10/22/2006 * New function: mob_cmds.c, lines 3205-3234 Prototype added in: mob_cmds.h, line 144 Implemented "obj at" command [/code]

  • registered

    Not that I'm a coder or anything, but since I have access to this forum, I'll see what I can help with… First off ```` * Fix: hunt.c, line 513 Commented out a check for ranger within a check for trackless step to include the possibility of others such as NPC rangers having the skill (and causing crashes). ```` Could you clarify that? I'm sure that coders would know what that means just by looking, but it could help with posting change logs. Do you mean that you removed the check for trackless step in the hunt code? Or did you remove a check to see IF the target is/was a ranger, but leaving the skill check for use with the possibility of, say, NPCs having the trackless step skill? Just curious. Seemed a bit ambiguous.

  • retired

    ~~@Nibelung:~~ > Not that I'm a coder or anything, but since I have access to this forum, I'll see what I can help with… > > First off > > ```` > * Fix: hunt.c, line 513 > > Commented out a check for ranger within a check for trackless step to include the possibility > of others such as NPC rangers having the skill (and causing crashes). > > ```` > > Could you clarify that? I'm sure that coders would know what that means just by looking, but it could help with posting change logs. Do you mean that you removed the check for trackless step in the hunt code? Or did you remove a check to see IF the target is/was a ranger, but leaving the skill check for use with the possibility of, say, NPCs having the trackless step skill? Just curious. Seemed a bit ambiguous. Oops, no I gave quite a shite summary of that. Here is the offending bit of code: ```` // For trackless step skill if (get_skill( victim, gsn_trackless_step ) > 0 //&& victim->pcdata->second_sub_class_cleric == CLASS_CLERIC_RANGER && ( victim->in_room->sector_type == SECT_FIELD || victim->in_room->sector_type == SECT_FOREST || victim->in_room->sector_type == SECT_HILLS || victim->in_room->sector_type == SECT_MOUNTAIN || victim->in_room->sector_type == SECT_TUNDRA ) ) { if ( number_percent() < get_skill( victim, gsn_trackless_step ) ) { sprintf(buf, "%s has covered $S tracks too well for you to follow.", IS_NPC(victim) ? victim->short_descr : victim->name); act(buf, ch, NULL, victim, TO_CHAR); return; } } ```` The fix I referred to is the commented-out AND statement which (1) crashes the game if the NPC is being checked, since the pcdata pointer is null on NPCs, and (2) is redundant anyway, since only rangers (and immortals, and currently mobs) have the trackless step skill. Hope this clarifies it for you - I have rephrased it in my changelog (see above).

  • registered

    [mr. burns]Excellent…[/mr. burns]

  • retired

    Backlogged on posting my changes here so I thought I'd fix that. ```` 12/21/2006 NOTE FROM SYN I am going to change the style of my code documentation a little bit to make it easier on me. First, I will post the same text in (a) my changelog included with the source code, (b) the coding board and (c) the in-game changes. (a) and (b) will also contain further information about the changes accessible to coders - this is generally a module name (e.g. fight.c), a function name, and a brief description of the change. I'm mostly trying to phase out recording line numbers except where necesarry since they change often with code editing and our functions aren't gargantuan, so a function name will usually suffice to locate a change. Obviously, information about the code will not be posted in-game, since this is easily accessible to coders via the MB. I will try my hardest to make my changes consistent, clear and concise to players, immortals, and coders alike, with additional information posted to coders to allow them to better understand my code. Of course, I will comment my changes within the code as well. * Fixed - NPCs couldn't initiate combat, leading to various issues involving NPC combat (aggro mobs not attacking, mounts of crusaders not helping them fight, and probably some others.) (fight.c, mob_hit(), commented out unnecesarry if-check) * Removed "Seralia/Athemia" points display, the awarding of military points, and the "xxx is now a pirate", announcement since they added absolutely nothing of value to gameplay. (act_info.c, do_score(), commented out bits about seralia/athemia points fight.c, player_kill(), commented out bit about pirates quests.c, do_quest(), commented out bit about military points) * Fixed - NPCs would wander off even if they were following or grouped with someone. (update.c, mobile_update(), a few additions and restructuring of some code) 12/12/2006 * Fixed - Reduced the hitting power and the skill levels of NPCs in the newbie area to make it a little easier on players who aren't used to the game. Also added a hint on practicing/training to the hints channel. * Fixed - The regeneration spell had a buggy duration when placed on objects. 11/06/2006 * Additions interp.c, 458, cmd_table interp.h, 441, prototype merc.h, 4000, #define olc.h, 36, #define olc_mpcode.c, 410-464, new function, do_tpedit olc_mpcode.c 62-62, tpedit command table 11/01/2006 * Fix: magic2.c Functions: spell_toxin_paralysis, spell_toxin_neurotoxin, spell_toxin_weakness, spell_toxin_venom Added echoarounds for when someone resists a Sith toxin bite so that the sith has an idea of what happened (why their bite didn't work.) Also fixed the current echos to the victim. * Fix: fight.c, line 4811 Fixed Sith bug where no matter what type of toxin you were trying to bite with, it would use paralysis - problem was checking "argument" instead of "arg2". * Addition: bit.c, line 344 tables.c, line 1160 merc.h, line 1562 auction.c, line 355 Implemented "noauction" object flag. * Addition: act_obj.c, lines 890, 1062 Additions to fix the "no_container" object flag. * Addition: act_comm.c, line 1240 Addition so room no_comm flag would block yells as well. 10/30/2006 * Addition: merc.h, line 1561 bit.c, line 343 locker.c, line 139 tables.c, line 1159 Implemented "no_locker" object2 flag. * Fix: olc.c, line 131 Inserted oedit_timer into the list of oedit commands. Not sure at all why it was off, but it's back on now. * Fix: fight.c, line 3873 and 3881 Changed it so non-imms can't see numerical values of hits unless on the test port. * Change: update.c, line Moved update_has_done (minor function that was sucking 10% of CPU time) from aggr_update to char_update. * Fix: const.c, line 3694 db.c, line 449 olc_act.c, line 5673 merc.h, line 215 and 4074 Added a mob skill level table generated at startup so that our processor won't be crunching a logarithm every time a skill lookup for an NPC is needed (often). * Fix: const.c, lines 1894-3688. Replaced the unused SLOT() field with a "race" field that specifies if the skill belongs to a certain race. This is to fix the problem of all NPCs having all racial skills regardless of their race. Right now unfortunately it doesn't account for racial skills that belong to more than one race such as shift - but I will replace this with a bitfield instead of an integer when I have the time. It works fine for now, since no automatic skills belong to more than one race, and those are the ones I wanted to correct first. * Fix: act_obj2.c, line 812 Added an "!IS_NPC()" ifcheck in do_consume to prevent segfaults when an NPC tries to consume a corpse. * Addition: merc.h, lines 248-273. Added a list of #defines for PC race types. These are now used in skill_table (const.c) to check for racial skills with a simple reference, rather than looping through the list of pc races and then looping through each race's list of skills. * Change: merc.h, line 3386. Added a "race" field to each skill. This replaced the old, unused "slot" place. I added this so that NPCs wouldn't use racial skills unless they were of that race. * Removal: act_wiz.c, lines 1739-45, 3248-86 Removed "slookup" function. Supposed to be for 'stat skill' which does nothing. * Addition: mob_prog.c, lines 2893-2988 Added a p_direction_trigger, almost identical to p_exit_trigger, except that it allows other trigger types (in this case, open and close) to fire on a direction. * Addition: act_move.c, lines 1129, 1224, 1166, 1253 Implemented open and close triggers for objects (first two lines) and doors (last two lines). * Addition: merc.h, lines 3454-3455 Added #define for open and close triggers for rooms and objects. ````

Log in to reply