mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-30 17:49:20 +02:00
remove corpse owner on every corpse after every 10s
This commit is contained in:
parent
ae7672ee55
commit
93f6c328fc
@ -712,6 +712,7 @@ bool Creature::dropCorpse(Creature* lastHitCreature, Creature* mostDamageCreatur
|
|||||||
if (corpse) {
|
if (corpse) {
|
||||||
g_game.internalAddItem(tile, corpse, INDEX_WHEREEVER, FLAG_NOLIMIT);
|
g_game.internalAddItem(tile, corpse, INDEX_WHEREEVER, FLAG_NOLIMIT);
|
||||||
g_game.startDecay(corpse);
|
g_game.startDecay(corpse);
|
||||||
|
g_scheduler.addEvent(createSchedulerTask(10000, std::bind(&Game::RemoveCorpseOwner, &g_game, corpse)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//scripting event - onDeath
|
//scripting event - onDeath
|
||||||
|
@ -3762,6 +3762,11 @@ void Game::internalDecayItem(Item* item)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Game::RemoveCorpseOwner(Item* item)
|
||||||
|
{
|
||||||
|
item->removeAttribute(ITEM_ATTRIBUTE_CORPSEOWNER);
|
||||||
|
}
|
||||||
|
|
||||||
void Game::checkDecay()
|
void Game::checkDecay()
|
||||||
{
|
{
|
||||||
g_scheduler.addEvent(createSchedulerTask(EVENT_DECAYINTERVAL, std::bind(&Game::checkDecay, this)));
|
g_scheduler.addEvent(createSchedulerTask(EVENT_DECAYINTERVAL, std::bind(&Game::checkDecay, this)));
|
||||||
|
@ -485,7 +485,7 @@ class Game
|
|||||||
void setBedSleeper(BedItem* bed, uint32_t guid);
|
void setBedSleeper(BedItem* bed, uint32_t guid);
|
||||||
void removeBedSleeper(uint32_t guid);
|
void removeBedSleeper(uint32_t guid);
|
||||||
bool reload(ReloadTypes_t reloadType);
|
bool reload(ReloadTypes_t reloadType);
|
||||||
|
void Game::RemoveCorpseOwner(Item* item);
|
||||||
Groups groups;
|
Groups groups;
|
||||||
Map map;
|
Map map;
|
||||||
Raids raids;
|
Raids raids;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user