mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-21 21:17:25 +00:00
script fixes (#1577)
fixes an issue where the sirens would not be destroyed correctly fixes undefined behavior in buff station ok for real this time actual fix for mermaids and for general death_behavior 0 skill stuff
This commit is contained in:
parent
8837b110ab
commit
35321b22d9
@ -1534,7 +1534,7 @@ void Entity::Kill(Entity* murderer, const eKillType killType) {
|
||||
bool waitForDeathAnimation = false;
|
||||
|
||||
if (destroyableComponent) {
|
||||
waitForDeathAnimation = destroyableComponent->GetDeathBehavior() == 0 && killType != eKillType::SILENT;
|
||||
waitForDeathAnimation = !destroyableComponent->GetIsSmashable() && destroyableComponent->GetDeathBehavior() == 0 && killType != eKillType::SILENT;
|
||||
}
|
||||
|
||||
// Live waited a hard coded 12 seconds for death animations of type 0 before networking destruction!
|
||||
|
@ -224,6 +224,16 @@ bool BehaviorContext::CalculateUpdate(const float deltaTime) {
|
||||
for (auto i = 0u; i < this->syncEntries.size(); ++i) {
|
||||
auto entry = this->syncEntries.at(i);
|
||||
|
||||
if (entry.behavior->m_templateId == BehaviorTemplate::ATTACK_DELAY) {
|
||||
auto* self = Game::entityManager->GetEntity(originator);
|
||||
if (self) {
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent && destroyableComponent->GetHealth() <= 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entry.time > 0) {
|
||||
entry.time -= deltaTime;
|
||||
|
||||
|
@ -56,10 +56,6 @@ void AgSurvivalBuffStation::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto member = Game::entityManager->GetEntity(memberID);
|
||||
if (member != nullptr && !member->GetIsDead()) {
|
||||
GameMessages::SendDropClientLoot(member, self->GetObjectID(), powerupToDrop, 0, self->GetPosition());
|
||||
} else {
|
||||
// If player left the team or left early erase them from the team variable.
|
||||
team.erase(std::find(team.begin(), team.end(), memberID));
|
||||
self->SetVar<std::vector<LWOOBJID>>(u"BuilderTeam", team);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user