refactor: remove heap-allocated AABBs

This commit is contained in:
orng
2026-03-28 02:58:56 -05:00
parent e48a05bb8f
commit 7101d03c6a
88 changed files with 353 additions and 387 deletions

View File

@@ -12,7 +12,7 @@ AreaHint::AreaHint(eTutorial_Hint id, Tutorial* tutorial,
double x1, double y1, double z1, bool allowFade /*= false*/,
bool contains /*= true*/)
: TutorialHint(id, tutorial, descriptionId, e_Hint_Area, allowFade) {
area = new AABB(x0, y0, z0, x1, y1, z1);
area = AABB(x0, y0, z0, x1, y1, z1);
this->contains = contains;
@@ -20,15 +20,13 @@ AreaHint::AreaHint(eTutorial_Hint id, Tutorial* tutorial,
m_completeState = completeState;
}
AreaHint::~AreaHint() { delete area; }
int AreaHint::tick() {
Minecraft* minecraft = Minecraft::GetInstance();
Vec3 player_pos = minecraft->player->getPos(1);
if ((m_displayState == e_Tutorial_State_Any ||
m_tutorial->getCurrentState() == m_displayState) &&
m_hintNeeded && area->contains(player_pos) == contains) {
m_hintNeeded && area.contains(player_pos) == contains) {
if (m_completeState == e_Tutorial_State_None) {
m_hintNeeded = false;
} else if (m_tutorial->isStateCompleted(m_completeState)) {