mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-10 09:28:06 +00:00
fix: the exploding script is the most amazing piece of code i have ev… (#1900)
* fix: the exploding script is the most amazing piece of code i have ever had the pleasure of working with and has been amazing to work on and translate from lua hahahahahahahahahahwwwwwwwwwwwwwwww草 * Enhance hit detection with proximity object checks Refactor hit handling to include proximity checks for destroyable entities.
This commit is contained in:
@@ -49,7 +49,7 @@ void ExplodingAsset::OnHit(Entity* self, Entity* attacker) {
|
||||
if (!self->GetBoolean(u"bIsHit")) {
|
||||
for (const auto objID : proximityComponent->GetProximityObjects("crateHitters")) {
|
||||
auto* const entity = Game::entityManager->GetEntity(objID);
|
||||
if (!entity || !entity->IsPlayer()) continue;
|
||||
if (!entity || entity->GetObjectID() != attacker->GetObjectID()) continue;
|
||||
|
||||
auto* const destroyable = entity->GetComponent<DestroyableComponent>();
|
||||
if (destroyable) destroyable->Smash(attacker->GetObjectID());
|
||||
|
Reference in New Issue
Block a user