Login
User Name:

Password:



Register

Forgot your password?
Hi - Clean SmaugFuss map/description issue..
Dec 15, 2024 7:29 pm
By Samson
AFKMud 2.2.4
Dec 10, 2024 4:09 pm
By Samson
I3 and IMC
Dec 8, 2024 6:35 pm
By Remcon
Ubuntu 22.04.5 LTS
Dec 5, 2024 5:10 pm
By Remcon
SmaugFUSS 1.8/1.9
Nov 29, 2024 11:46 am
By Remcon
SWFOTEFUSS 1.5.1
Author: Various
Submitted by: Samson
SWRFUSS 1.4.1
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.5
Author: Various
Submitted by: Samson
AFKMud 2.2.4
Author: AFKMud Team
Submitted by: Samson
LOP 1.5
Author: Remcon
Submitted by: Remcon
Users Online
AhrefsBot, Google, Bing

Members: 0
Guests: 35
Stats
Files
Topics
Posts
Members
Newest Member
494
3,808
19,707
588
Mortrex

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » 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 8:34 am   
Go to the top of the page
Go to the bottom of the page

Keirath
Magician
GroupMembers
Posts148
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 >>