Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
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
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Yandex, DotBot, Bing

Members: 0
Guests: 16
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Very minor setrace() bug.
Forum Rules | Mark all | Recent Posts

Very minor setrace() bug.
< Newer Topic :: Older Topic > Just a missing '!'.

Pages:<< prev 1 next >>
Post is unread #1 Feb 23, 2012, 6:22 am
Go to the top of the page
Go to the bottom of the page

Kronotross
Fledgling
GroupMembers
Posts5
JoinedFeb 23, 2012

Just a missing ! on line 7654 of act_wiz.cpp in the setrace command:

 if( !str_cmp( arg2, "bodyparts" ) || str_cmp( arg2, "part" ) ) 


Should be:

 if( !str_cmp( arg2, "bodyparts" ) || !str_cmp( arg2, "part" ) ) 


Or all of the following arguments will get stuck on setting bodyparts as they don't match "part", true is false and false is true, cats and dogs sleeping together, et cetera.

Figured this was the best place to throw in a quick bug report. Playing around with the codebase and liking what I see so far; maybe I'll actually get somewhere with it? Who knows.

Anyway thanks for making it,
Toodles
       
Post is unread #2 Feb 23, 2012, 7:32 am
Go to the top of the page
Go to the bottom of the page

Kronotross
Fledgling
GroupMembers
Posts5
JoinedFeb 23, 2012

Didn't expect to find another one, but here's another do_setrace bug, though it involves more than a missing !.

The problem is, if you try to "setrace whatever language common" then it tells you players cannot speak common. What's actually happening is there is a check for "value &= VALID_LANGS" and the value for "common" is 0, as enums start at 0. 0 & X = 0, so setrace could never toggle common language.

The codebase is set up in a way that makes it easy to fix.

mudcfg.h line 435
LANG_COMMON, LANG_ELVEN, LANG_DWARVEN, LANG_PIXIE, 

change to
LANG_COMMON=1, LANG_ELVEN, LANG_DWARVEN, LANG_PIXIE,


Now all of the languages are bumped one value higher. Next:

build.cpp line 301
"common", "elvish", "dwarven", "pixie", "ogre",

These are in an array, so they still start at 0. Inserting a dummy language for 0:
"gibberish", "common", "elvish", "dwarven", "pixie", "ogre",


Means now common = 1 = common, and so on.

Logically, this is all that needs to happen because race files store them in string form so nothing will visibly change from inside the MUD.

However I wanted to save this one loop iteration worth of process time because I am crazy:

build.cpp line 830
for( size_t x = 0; x < ( sizeof( lang_names ) / sizeof( lang_names[0] ) ); ++x )

to
for( size_t x = 1; x < ( sizeof( lang_names ) / sizeof( lang_names[0] ) ); ++x )


So now it won't waste its time comparing against "gibberish" because it'll never come up.

And yes, I could have just opened the race files and edited "common" in or out of any race, but... I don't know, I'm crazy. I haven't even checked how/if languages operate. BUT STILL.

Anyway thanks again.
       
Post is unread #3 Feb 25, 2012, 8:24 am
Go to the top of the page
Go to the bottom of the page

Kronotross
Fledgling
GroupMembers
Posts5
JoinedFeb 23, 2012

This is another really minor fix even though it doesn't deal with setrace. Rather than spamming the forums with a bunch of threads I figured I'd just add it here.

Basically there just seemed to be a missing newline for each iteration of the who loop, because when multiple people were online it did this:

--------------------------------=[ Players ]=---------------------------------

      Warrior       [-----] Someguy the Newbie      Warrior       [-----] 
Notkrono the Newbie

So on lines 1240 and 1245 of player.cpp I added a ch->pager after each output_person as so:

ch->pager( output_person( ch, player ) );
ch->pager( "\r\n" );

And now it looks right.
       
Pages:<< prev 1 next >>