Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 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
LoP 1.46
Author: Remcon
Submitted by: Remcon
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
Users Online
CommonCrawl, Yandex, Yahoo!, Google

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SmaugFUSS Bugfix List » [Bug] Shove and drag commands...
Forum Rules | Mark all | Recent Posts

[Bug] Shove and drag commands using hardcoded race values
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Apr 16, 2005, 11:17 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Shove and drag commands using hardcoded race values. Also missing some races.
Danger: Medium - Changes to the racial numbers will make this data useless.
Found by: GatewaySysop
Fixed by: Samson

---

clans.c, do_shove

Locate:
   if( ch->race == 1 )
      race_bonus = -3;

   if( ch->race == 2 )
      race_bonus = 3;

   if( ch->race == 3 )
      race_bonus = -5;

   if( ch->race == 4 )
      race_bonus = -7;

   if( ch->race == 6 )
      race_bonus = 5;

   if( ch->race == 7 )
      race_bonus = 7;

   if( ch->race == 8 )
      race_bonus = 10;

   if( ch->race == 9 )
      race_bonus = -2;


Change to:
/* Check for race, adjust percentage based on that. */
   if( ch->race == RACE_ELF )
      race_bonus = -3;

   if( ch->race == RACE_DWARF )
      race_bonus = 3;

   if( ch->race == RACE_HALFLING )
      race_bonus = -5;

   if( ch->race == RACE_PIXIE )
      race_bonus = -7;

   if( ch->race == RACE_HALF_OGRE )
      race_bonus = 5;

   if( ch->race == RACE_HALF_ORC )
      race_bonus = 7;

   if( ch->race == RACE_HALF_TROLL )
      race_bonus = 10;

   if( ch->race == RACE_HALF_ELF )
      race_bonus = -2;

   if( ch->race == RACE_GITH )
      race_bonus = -2;

   if( ch->race == RACE_PIXIE )
      race_bonus = -7;

   if( ch->race == RACE_DROW )
      race_bonus = 1;

   if( ch->race == RACE_SEA_ELF )
      race_bonus = -1;

   if( ch->race == RACE_LIZARDMAN )
      race_bonus = 4;

   if( ch->race == RACE_GNOME )
      race_bonus = -2;


Replace the same chunks of code in the do_drag function.

SMAUG is rife with instances of using hardcoded values when things should be using variable definitions wherever possible. This is one such instance. Perhaps these functions have been overlooked because the commands simply don't get used much.
       
Pages:<< prev 1 next >>