RE: [SMAUG] regen help
RE: [SMAUG] regen help
If you follow the instructions that DOES change the time it takes to
regen. If you read it, it specifcally states it changes it to once per
second instead of once per tick.
void char_regen( void );
That is a declaration.
In order to use a function anywhere in the code other than below where
the function is written you must have a declaration somewhere higher up
so the code knows what the function does and what arguments to take.
So if you intend to put a call inside the function update_handler() to
char_regen() you need to either
A) Put all the code for char_regen before update_handler() starts.
B) Put a declaration for char_regen before update_handler() starts.
Option A) is only available for code that is only to appear once in a
specific place, or in a specific file where everything else can appear
below it.
Otherwise if you're going to call something in multiple files you need a
declaration of it in each of those files.
At the top of nearly every .c file in SMAUG you will find several
declarations after all the #includes to make some of the more common
things available. Inside mud.h you will find a lot more because things
that are used in nearly file are a lot easier to write in mud.h once
than to declare over and over and over and over in every single file.
Saves time. Saves space.
-----Original Message-----
From: owner-smaug@game.org [mailto:owner-smaug@game.org] On Behalf Of
R6Raider@aol.com
Sent: Tuesday, October 21, 2003 10:56 PM
To: smaug@realms.game.org
Subject: [SMAUG] regen help
heya,
thanks for that code, it looks like it will do what i need. Questions.
"You'll have to declare it at the top of course." What does that mean?
And how do i change the rate of regen time?
Mike