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, DotBot

Members: 0
Guests: 8
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 » General » Smaug Snippets » About alias.c
Forum Rules | Mark all | Recent Posts

About alias.c
< Newer Topic :: Older Topic > (Instruction)

Pages:<< prev 1 next >>
Post is unread #1 Dec 5, 2003, 6:33 am
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

Hello

I have download alias snippet from site and in the Alias.txt guide I read:
----------------------------------------------------------------
In the char_data struct, add the following to the end:

sh_int cmd_recurse;

In the pc_data struct, add the following to the end:

ALIAS_DATA *first_alias;
ALIAS_DATA *last_alias;
---------------------------------------------------------------

so, now I add:

struct char_data
{
CHAR_DATA * next;
CHAR_DATA * prev;



ROOM_INDEX_DATA * in_room;
ROOM_INDEX_DATA * was_in_room;
PC_DATA * pcdata;
DO_FUN * last_cmd;
DO_FUN * prev_cmd; /* mapping */



int retran;
int regoto;
sh_int mobinvis; /* Mobinvis level SB */
sh_int colors[MAX_COLORS];
sh_int cmd_recurse; // aggiunto per alias
};

and also...:

struct pc_data
{
CHAR_DATA * pet;
CLAN_DATA * clan;
COUNCIL_DATA * council;



bool norares; /* rent matteo - Toggled so we can tell the PC he ran out of money - Samson 1-24-00 */
bool autorent; /* rent matteo - Is this PC an autorent? - Samson 7-27-00 */
#ifdef I3
I3_CHARDATA *i3chardata;
#endif
ALIAS_DATA *first_alias; // aggiunto per l'alias
ALIAS_DATA *last_alias; // aggiunto per l'alias
};


But, when I compile read:
-----------------------------------------------------------------------
gcc -c -O -g2 -Wall -DI3 -DI3SMAUG alias.c
alias.c: In function `check_alias':
alias.c:147: error: structure has no member named `cmd_recurse'
-----------------------------------------------------------------------

So I look in function check_alias on alias.c where there is:

if( ch->cmd_recurse == -1 || ++ch->cmd_recurse > 50 )
{
if ( ch->pcdata->cmd_recurse != -1 ) <--- HERE
{
send_to_char( "Unable to further process command, recurses too much.
", ch );
ch->cmd_recurse = -1;
}
return FALSE;
}

But, is it wrong?
Could be:
if ( ch->cmd_recurse != -1 )
instead of:
if ( ch->pcdata->cmd_recurse != -1 ) ??


bye at all
matteo
       
Post is unread #2 Dec 6, 2003, 7:02 pm
Go to the top of the page
Go to the bottom of the page

Odis

GroupMembers
Posts46
JoinedMar 8, 2005

I doubt it matters to much. They both accomplish the same thing, just using different structures.
       
Post is unread #3 Dec 6, 2003, 7:35 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

It should be using ch->cmd_recurse. The pcdata bit was an error on my part when updating the code last.
       
Post is unread #4 Dec 7, 2003, 1:56 pm
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

Thank you Samson e Odis for help.

bye and good work
matteo
       
* #5 Apr 3, 2005, 3:32 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

I have tried to install the alias snippet on my SmaugFUSS 1.4a mud and I believe that I have followed all of the installation instructions to the letter, but when I compile I get the following output:

Compiling o/alias.o....
alias.c: In function 'do_alias':
alias.c:60: error: 'MIL' undeclared (first use in this function)
alias.c:60: error: (Each undeclared identifier is reported only once
alias.c:60: error: for each function it appears in.)
alias.c:60: warning: unused variable 'arg'
alias.c: In function 'check_alias':
alias.c:134: error: 'MIL' undeclared (first use in this function)
alias.c:134: warning: unused variable 'arg'
make[1]: *** [o/alias.o] Error 1
make: *** [all] Error 2

Now I've checked these two lines in alias.c (which is unaltered from what I downloaded) and both lines read:

char arg[MIL]

and I have no idea what MIL is supposed to represent (unless it's middle, initial, last) or where/how I need to declare it. (I did try to comment out those two lines to see if it would comile cleanly without them since it said arg is an unused variable, but then I get errors on lines 75 & 143 about arg & MIL being undeclared)... any help or suggestions here would be immensely appreciated.
-=Conner=-
Land of Legends MUD
telnet to tcdbbs.zapto.org port 4000
http://tcdbbs.zapto.org
       
* #6 Apr 3, 2005, 3:49 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

ok, just rechecked the download section and it appears that the alias snippet sitting there is somehow dated prior to when I downloaded the snippet by ten months but still has very different data inside, particularily the alias.c file, so i'm going to install it instead and see if that resolves the issue... btw, the newer file references Max_Input_Length instead of MIL...
       
Post is unread #7 Apr 3, 2005, 6:14 pm   Last edited Apr 3, 2005, 6:14 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Well unless you downloaded the snippet from us in October of 2005, I don't see how that could be possible. The files in the download are dated 12/18/2004 and contain no references to MIL.
       
* #8 Apr 3, 2005, 7:02 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Actually, I may have downloaded the snippet back in October (of 2004), but it's taken me awhile to get around to some of these snippets. The odd thing is that the downloads section labels the newest updates as being valentine's of 2004. *shrug*

In any event, downloading the updated snippet for it did the job, it's installed and working perfectly.

Thanks for sharing all these great snippets with us Samson!
       
Post is unread #9 Apr 3, 2005, 7:24 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Glad you got it working, but I guess my cheap humor got overlooked again... October 2005 wasn't a typo :)
       
* #10 Apr 4, 2005, 2:55 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

It wasn't? I assumed it must have been since it's only April of 2005... though, you said that the files are all dated 12/18/04, but on the downloads page, it says that they were last updated 2/14/04 which is why I assumed that I had the most up to date version, though downloading it again yesterday did solve the problem so must be something with the web page not reflecting the correct last update date. Sorry that I didn't catch your sly humor, guess I haven't been here long enough to recognize it yet.
       
Pages:<< prev 1 next >>