Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!

Members: 0
Guests: 7
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » Unused Data - mdeaths/pdeaths...
Forum Rules | Mark all | Recent Posts

Unused Data - mdeaths/pdeaths/illegal_pk
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Feb 24, 2010, 6:34 am
Go to the top of the page
Go to the bottom of the page

Keirath
Magician
GroupMembers
Posts144
JoinedJan 24, 2008

There are several things in SWR1.3FUSS I've found that are excessive and unused. I figure if you guys are like me - I like to have the code as clean as possible.

In struct pc_data:
   int pdeaths;   /* Number of times pkilled (legally)  */
   int mdeaths;   /* Number of deaths due to mobs       */
   int illegal_pk;   /* Number of illegal pk's committed   */

illegal_pk is also referenced in area_data and should be removed. I would leave all other references to mdeaths and pdeaths for clans/areas. This is a good way to keep track of what goes on in your areas and clans. It just doesn't need to save to a character.

This prototype can also be removed.
bool check_illegal_pk args( ( CHAR_DATA * ch, CHAR_DATA * victim ) );


Since the code institutes permanent death pdeaths and mdeaths aren't needed - as a players file is removed upon their death.. Illegal_PK is no longer utilized either.

In act_info.c, function do_whois.
Change:
      ch_printf( ch, "%s has killed %d mobiles, and been killed by a mobile %d times.\r\n",
                 victim->name, victim->pcdata->mkills, victim->pcdata->mdeaths );

      if( victim->pcdata->pkills || victim->pcdata->pdeaths )
         ch_printf( ch, "%s has killed %d players, and been killed by a player %d times.\r\n",
                    victim->name, victim->pcdata->pkills, victim->pcdata->pdeaths );
      if( victim->pcdata->illegal_pk )
         ch_printf( ch, "%s has committed %d illegal player kills.\r\n", victim->name, victim->pcdata->illegal_pk );


to
      ch_printf( ch, "%s has killed %d mobiles and %d players.\r\n", victim->name, victim->pcdata->mkills, victim->pcdata->pkills )


In act_wiz.c - function do_mstat:
Change
   
         ch_printf( ch, "Vnum: %d   Sex: %s   Room: %d   Count: %d  Killed: %d\r\n",
              IS_NPC( victim ) ? victim->pIndexData->vnum : 0,
              victim->sex == SEX_MALE ? "male" :
              victim->sex == SEX_FEMALE ? "female" : "neutral",
              victim->in_room == NULL ? 0 : victim->in_room->vnum,
              IS_NPC( victim ) ? victim->pIndexData->count : 1,
              IS_NPC( victim ) ? victim->pIndexData->killed : victim->pcdata->mdeaths + victim->pcdata->pdeaths );


To
   ch_printf( ch, "Sex: %s   Room: %d\r\n",
              victim->sex == SEX_MALE ? "male" :
              victim->sex == SEX_FEMALE ? "female" : "neutral",
              victim->in_room == NULL ? 0 : victim->in_room->vnum );

   if( IS_NPC( victim ))
     ch_printf( ch, "Vnum: %d   Count: %d  Killed: %d\r\n", victim->pIndexData->vnum, victim->pIndexData->count, victim->pIndexData->killed );


In build.c - function do_astat - change
     ch_printf( ch, "Max players: %d  IllegalPks: %d  Credits Looted: %d\r\n",
                 tarea->max_players, tarea->illegal_pk, tarea->gold_looted );

To
     ch_printf( ch, "Max players: %d  Credits Looted: %d\r\n",
                 tarea->max_players, tarea->gold_looted );


Remove the following lines from fwrite_char in save.c
      if( ch->pcdata->pdeaths )
         fprintf( fp, "PDeaths      %d\n", ch->pcdata->pdeaths )

      fprintf( fp, "MDeaths      %d\n", ch->pcdata->mdeaths );
      if( ch->pcdata->illegal_pk )
         fprintf( fp, "IllegalPK    %d\n", ch->pcdata->illegal_pk );


Remove the following lines from fread_char - save.c

            KEY( "IllegalPK", ch->pcdata->illegal_pk, fread_number( fp ) );

            KEY( "MDeaths", ch->pcdata->mdeaths, fread_number( fp ) );

            KEY( "PDeaths", ch->pcdata->pdeaths, fread_number( fp ) );


And that's it. That cleans up that bit.





       
Pages:<< prev 1 next >>