Unused Data - mdeaths/pdeaths/illegal_pk
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Feb 24, 2010 8:34 am
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:
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.
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:
to
In act_wiz.c - function do_mstat:
Change
To
In build.c - function do_astat - change
To
Remove the following lines from fwrite_char in save.c
Remove the following lines from fread_char - save.c
And that's it. That cleans up that bit.
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 >>