mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-18 17:48:06 +00:00
refactor: remove calls to Vec3::newTemp and Vec3::newPermanent
This commit is contained in:
@@ -25,8 +25,8 @@ AreaConstraint::~AreaConstraint() {
|
||||
|
||||
bool AreaConstraint::isConstraintSatisfied(int iPad) {
|
||||
Minecraft* minecraft = Minecraft::GetInstance();
|
||||
return messageArea->contains(minecraft->localplayers[iPad]->getPos(1)) ==
|
||||
contains;
|
||||
Vec3 ipad_player = minecraft->localplayers[iPad]->getPos(1);
|
||||
return messageArea->contains(&ipad_player) == contains;
|
||||
}
|
||||
|
||||
bool AreaConstraint::isConstraintRestrictive(int iPad) {
|
||||
|
||||
@@ -24,10 +24,12 @@ 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(minecraft->player->getPos(1)) == contains) {
|
||||
area->contains(&player_pos) == contains) {
|
||||
if (m_completeState == e_Tutorial_State_None) {
|
||||
m_hintNeeded = false;
|
||||
} else if (m_tutorial->isStateCompleted(m_completeState)) {
|
||||
|
||||
@@ -85,8 +85,9 @@ void ChangeStateConstraint::tick(int iPad) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Vec3 ipad_player = minecraft->localplayers[iPad]->getPos(1);
|
||||
if (!m_bHasChanged && inASourceState &&
|
||||
movementArea->contains(minecraft->localplayers[iPad]->getPos(1)) ==
|
||||
movementArea->contains(&ipad_player) ==
|
||||
contains) {
|
||||
m_bHasChanged = true;
|
||||
m_changedFromState = m_tutorial->getCurrentState();
|
||||
@@ -126,7 +127,7 @@ void ChangeStateConstraint::tick(int iPad) {
|
||||
}
|
||||
} else if (m_bHasChanged &&
|
||||
movementArea->contains(
|
||||
minecraft->localplayers[iPad]->getPos(1)) != contains) {
|
||||
&ipad_player) != contains) {
|
||||
m_bHasChanged = false;
|
||||
m_tutorial->changeTutorialState(m_changedFromState);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user