cannot override worldTick()?
Posted: Tue May 08, 2018 11:13 am
Hi, I'm trying to make an eventhandler.
Here's the code:
It gives me error: Attempt to override non-existent virtual function WorldTick
What's giong on? I think the inheritance should work...? Or what am I ding wrong?
Here's the code:
Code: Select all
class itemsWatcher : EventHandler
{
int watcher_tick;
override void WorldTick(PlayerEvent e)
{
let player = players[e.PlayerNumber].mo;
watcher_tick++;
if(watcher_tick == 35)
{
watcher_tick = 0;
//night-eye device
if(player.countinv("NightEyeDevice") <= 1)
{
//A_Print("Night-Eye Device depleted!", 0, "smallfont");
player.takeinventory("PowerLantern", 1);
player.takeinventory("LanternActive", 1);
return;
}
}
super.WorldTick();
}
}
What's giong on? I think the inheritance should work...? Or what am I ding wrong?