All my monsters spawn in 60 seconds after die
I want change it according the players online
I'm trying to make something like it:
Where I need to edit in my sources?
I'm using 0.4
I've tried change in spawn.h
To
Full code
http://hastebin.com/ohuheqicox.cs
But I got some errors:
What I supossed to do?
I want change it according the players online
I'm trying to make something like it:
Code:
rateSpawn = 1 + (playerCount > 0 and (playerCount / 50) or 0),
Where I need to edit in my sources?
I'm using 0.4
I've tried change in spawn.h
Code:
uint32_t getInterval() const {return interval;}
To
Code:
uint32_t getInterval() const {
double bonusinterval = 1 + (g_game.getPlayersOnline() / 50.);
return (uint32_t)std::ceil(interval / bonusinterval);
}
Full code
http://hastebin.com/ohuheqicox.cs
But I got some errors:
Code:
luascript.h:67:7: note: forward declaration of ‘class Game’
class Game;
^
In file included from game.h:27:0,
from beds.cpp:25:
spawn.h: In member function ‘uint32_t Spawn::getInterval() const’:
spawn.h:89:40: error: invalid use of incomplete type ‘class Game’
double bonusinterval = 1 + (g_game.getPlayersOnline() / 50.);
^
In file included from baseevents.h:22:0,
from raids.h:26,
from item.h:29,
from beds.h:20,
from beds.cpp:19:
luascript.h:67:7: note: forward declaration of ‘class Game’
class Game;
^
In file included from game.h:27:0,
from actions.cpp:30:
spawn.h: In member function ‘uint32_t Spawn::getInterval() const’:
spawn.h:89:40: error: invalid use of incomplete type ‘class Game’
double bonusinterval = 1 + (g_game.getPlayersOnline() / 50.);
^
In file included from baseevents.h:22:0,
from actions.h:20,
from actions.cpp:20:
luascript.h:67:7: note: forward declaration of ‘class Game’
class Game;
^
Makefile:546: recipe for target 'beds.o' failed
make[1]: *** [beds.o] Error 1
make[1]: ** Esperando que outros processos terminem.
Makefile:546: recipe for target 'chat.o' failed
make[1]: *** [chat.o] Error 1
Makefile:546: recipe for target 'actions.o' failed
make[1]: *** [actions.o] Error 1
make[1]: Leaving directory '/home/tiago/Documentos/warcera/3777/src'
Makefile:403: recipe for target 'all' failed
make: *** [all] Error 2
What I supossed to do?
Last edited: