Bug in format_obj_to_char( )
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Jan 12, 2017 3:27 am
Conjurer
GroupMembers
Posts413
JoinedMar 7, 2005
Another one that I found recently. Not sure if someone was just really confused when they did this or what, but the more I looked, the less sense it made.
Original code is found in act_info.c, format_obj_to_char( )
Am I crazy, or should that not be written like this instead?
Original code is found in act_info.c, format_obj_to_char( )
if( ch->Class == CLASS_PALADIN && ( IS_OBJ_STAT( obj, ITEM_ANTI_EVIL ) && !IS_OBJ_STAT( obj, ITEM_ANTI_NEUTRAL ) && !IS_OBJ_STAT( obj, ITEM_ANTI_GOOD ) ) ) mudstrlcat( buf, "(Flaming Red) ", MAX_STRING_LENGTH ); if( ch->Class == CLASS_PALADIN && ( !IS_OBJ_STAT( obj, ITEM_ANTI_EVIL ) && IS_OBJ_STAT( obj, ITEM_ANTI_NEUTRAL ) && !IS_OBJ_STAT( obj, ITEM_ANTI_GOOD ) ) ) mudstrlcat( buf, "(Flaming Grey) ", MAX_STRING_LENGTH ); if( ch->Class == CLASS_PALADIN && ( !IS_OBJ_STAT( obj, ITEM_ANTI_EVIL ) && !IS_OBJ_STAT( obj, ITEM_ANTI_NEUTRAL ) && IS_OBJ_STAT( obj, ITEM_ANTI_GOOD ) ) ) mudstrlcat( buf, "(Flaming White) ", MAX_STRING_LENGTH ); if( ch->Class == CLASS_PALADIN && ( IS_OBJ_STAT( obj, ITEM_ANTI_EVIL ) && IS_OBJ_STAT( obj, ITEM_ANTI_NEUTRAL ) && !IS_OBJ_STAT( obj, ITEM_ANTI_GOOD ) ) ) mudstrlcat( buf, "(Smouldering Red-Grey) ", MAX_STRING_LENGTH ); if( ch->Class == CLASS_PALADIN && ( IS_OBJ_STAT( obj, ITEM_ANTI_EVIL ) && !IS_OBJ_STAT( obj, ITEM_ANTI_NEUTRAL ) && IS_OBJ_STAT( obj, ITEM_ANTI_GOOD ) ) ) mudstrlcat( buf, "(Smouldering Red-White) ", MAX_STRING_LENGTH ); if( ch->Class == CLASS_PALADIN && ( !IS_OBJ_STAT( obj, ITEM_ANTI_EVIL ) && IS_OBJ_STAT( obj, ITEM_ANTI_NEUTRAL ) && IS_OBJ_STAT( obj, ITEM_ANTI_GOOD ) ) ) mudstrlcat( buf, "(Smouldering Grey-White) ", MAX_STRING_LENGTH );
Am I crazy, or should that not be written like this instead?
if ( ch->Class==CLASS_PALADIN && ( IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) && !IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL) && !IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)) ) mudstrlcat( buf, "(Smouldering Grey-White) ", MAX_STRING_LENGTH ); if ( ch->Class==CLASS_PALADIN && ( !IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) && IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL) && !IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)) ) mudstrlcat( buf, "(Smouldering Red-White) ", MAX_STRING_LENGTH ); if ( ch->Class==CLASS_PALADIN && (!IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) && !IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL) && IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)) ) mudstrlcat( buf, "(Smouldering Red-Grey) ", MAX_STRING_LENGTH ); if ( ch->Class==CLASS_PALADIN && ( IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) && IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL) && !IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)) ) mudstrlcat( buf, "(Burning White) ", MAX_STRING_LENGTH ); if ( ch->Class==CLASS_PALADIN && ( IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) && !IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL) && IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)) ) mudstrlcat( buf, "(Burning Grey) ", MAX_STRING_LENGTH ); if ( ch->Class==CLASS_PALADIN && ( !IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) && IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL) && IS_OBJ_STAT(obj, ITEM_ANTI_GOOD)) ) mudstrlcat( buf, "(Burning Red) ", MAX_STRING_LENGTH );
#2 Jan 12, 2017 5:02 pm
Fledgling
GroupMembers
Posts24
JoinedJan 7, 2010
I would make (and have made) this change. The rest of the SMAUG code traditionally uses the Red=Evil, Grey=Neutral, White=Good format, so this makes sense. Implemented.
#3 Jan 12, 2017 6:38 pm
Conjurer
GroupMembers
Posts413
JoinedMar 7, 2005
Sadiq said:
I would make (and have made) this change. The rest of the SMAUG code traditionally uses the Red=Evil, Grey=Neutral, White=Good format, so this makes sense. Implemented.
I knew I wasn't crazy! Thanks for the confirmation.
#4 Jan 13, 2017 12:01 pm
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005
thanks while i had changed the whole look of that stuff because of how confusing it looked i hadn't paid the stuff it showed any attention, modified it
Pages:<< prev 1 next >>