mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Instance] Clear Respawn Timers on Creation (#4801)
* [DZ] Clear Respawn Timers on Creation * Revert "[DZ] Clear Respawn Timers on Creation" This reverts commit ae18b77e8361a41c25e9b97812c7a4ab97715bb4. * Clear respawn times on instance creation
This commit is contained in:
parent
96e34fe8f7
commit
44497414db
@ -129,6 +129,8 @@ bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version
|
|||||||
e.start_time = std::time(nullptr);
|
e.start_time = std::time(nullptr);
|
||||||
e.duration = duration;
|
e.duration = duration;
|
||||||
|
|
||||||
|
RespawnTimesRepository::ClearInstanceTimers(*this, e.id);
|
||||||
|
|
||||||
return InstanceListRepository::InsertOne(*this, e).id;
|
return InstanceListRepository::InsertOne(*this, e).id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -77,6 +77,11 @@ public:
|
|||||||
|
|
||||||
return ((r.start + r.duration) - time_seconds);
|
return ((r.start + r.duration) - time_seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ClearInstanceTimers(Database &db, int32_t id)
|
||||||
|
{
|
||||||
|
RespawnTimesRepository::DeleteWhere(db, fmt::format("`instance_id` = {}", id));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //EQEMU_RESPAWN_TIMES_REPOSITORY_H
|
#endif //EQEMU_RESPAWN_TIMES_REPOSITORY_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user