aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/GameObject
diff options
context:
space:
mode:
authorJeremy <Golrag@users.noreply.github.com>2023-07-30 19:49:12 +0200
committerGitHub <noreply@github.com>2023-07-30 19:49:12 +0200
commitf5461a1161a5a9dfabe7a142ad84f8c900776c92 (patch)
tree4f327bbb5752acd5c8f75d5552ddd0489d76c0dc /src/server/game/Entities/GameObject
parent845f61e0a969891b14e1f182fadd29af347a1a3f (diff)
Battlegrounds/Buffs: Rework using areatriggers (#29171)
* Rework GameObject trap handling for buffs (removed radius hack) * Add script for Old AreaTriggers * Add script for new AreaTriggers * Spawn AreaTriggers in Arathi Basin
Diffstat (limited to 'src/server/game/Entities/GameObject')
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index df5c39ecffa..b7d77cad622 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -1150,17 +1150,9 @@ void GameObject::Update(uint32 diff)
// Type 0 despawns after being triggered, type 1 does not.
/// @todo This is activation radius. Casting radius must be selected from spell data.
- float radius;
- if (!goInfo->trap.radius)
- {
- // Battleground traps: data2 == 0 && data5 == 3
- if (goInfo->trap.cooldown != 3)
- break;
-
- radius = 3.f;
- }
- else
- radius = goInfo->trap.radius / 2.f;
+ float radius = goInfo->trap.radius / 2.f; // this division seems to date back to when the field was called diameter, don't think it is still relevant.
+ if (!radius)
+ break;
// Pointer to appropriate target if found any
Unit* target = nullptr;
@@ -1301,12 +1293,6 @@ void GameObject::Update(uint32 diff)
SetLootState(GO_JUST_DEACTIVATED);
else if (!goInfo->trap.charges)
SetLootState(GO_READY);
-
- // Battleground gameobjects have data2 == 0 && data5 == 3
- if (!goInfo->trap.radius && goInfo->trap.cooldown == 3)
- if (Player* player = target->ToPlayer())
- if (Battleground* bg = player->GetBattleground())
- bg->HandleTriggerBuff(GetGUID());
}
break;
}