Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Today, 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, Yandex, DotBot, Google, Yahoo!, Majestic-12

Members: 0
Guests: 8
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 » General » Smaug Snippets » Stat Reroll error
Forum Rules | Mark all | Recent Posts

Stat Reroll error
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 May 21, 2009, 12:02 pm
Go to the top of the page
Go to the bottom of the page

Hanaisse
Magician
GroupMembers
Posts196
JoinedNov 25, 2007

Adding the stat roller to my SmaugFUSS 1.9 and running into some issues. The snippet is obviously written for Smaug 1.4a. Could someone tell me how to fix this error?

comm.c: In function void nanny_get_new_race(DESCRIPTOR_DATA*, const char*)
comm.c:2328: error: buf was not declared in this scope


This is the line of code from the snippet;

snprintf( buf, MAX_STRING_LENGTH, "\r\nStr: %d  Int: %d  Wis: %d  Dex: %d  Con: %d  Cha: %d  Lck: %d\r\nKeep? (Y/N)",


       
Post is unread #2 May 21, 2009, 12:04 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

It's filling up a temporary buffer, and will later (presumably) print that buffer to the character. You can declare the buffer by doing something like char buf[MAX_INPUT_LENGTH] but if you don't also send it, it's kind of an exercise in futility.
       
Post is unread #3 May 21, 2009, 12:20 pm
Go to the top of the page
Go to the bottom of the page

Hanaisse
Magician
GroupMembers
Posts196
JoinedNov 25, 2007

It's already declared with a char buf[MAX_STRING_LENGTH]. How do I get it to send?
       
Post is unread #4 May 21, 2009, 1:02 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Well, apparently it's not already declared, because otherwise you wouldn't have gotten the error... :wink:

You would send it using one of the normal methods, like send_to_char or whatever.
       
Post is unread #5 May 21, 2009, 3:17 pm
Go to the top of the page
Go to the bottom of the page

Hanaisse
Magician
GroupMembers
Posts196
JoinedNov 25, 2007

Hmm, it was declared in the function below it and I thought it was in this function but it was declaring an arg. So I added the buf below that and it compiles and works clean.

My first attempt at playing with the code and I actually managed to write a new nanny function :)
       
Pages:<< prev 1 next >>