mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-23 22:17:31 +00:00
2a0f63c0a1
Fixes an issue where most smashables did not explode into bricks upon death. This included anything that was spawned or didnt have the flag is_smashable set. Tested that in races, all objects smash into bricks Tested that the player properly explodes in their car if they crash Tested that Shooting Gallery plays the special smash animation when a ship is smashed Tested that all spawned objects play smash animations * Fix warning, Fix modular assembly not smashing * Rename variable to correct name
19 lines
520 B
C++
19 lines
520 B
C++
#include "BuccaneerValiantShip.h"
|
|
#include "SkillComponent.h"
|
|
|
|
void BuccaneerValiantShip::OnStartup(Entity* self) {
|
|
self->AddCallbackTimer(1.0F, [self]() {
|
|
auto* skillComponent = self->GetComponent<SkillComponent>();
|
|
auto* owner = self->GetOwner();
|
|
|
|
if (skillComponent != nullptr && owner != nullptr) {
|
|
skillComponent->CalculateBehavior(982, 20577, LWOOBJID_EMPTY, true, false, owner->GetObjectID());
|
|
|
|
// Kill self if missed
|
|
self->AddCallbackTimer(1.1F, [self]() {
|
|
self->Smash();
|
|
});
|
|
}
|
|
});
|
|
}
|