User Name:


Forgot your password?
Vote for Us!
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot, Bing

Members: 0
Guests: 18
Newest Member
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

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.
      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 );

      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:
         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 );

   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 );

     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 >>