mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-16 04:51:16 +00:00
Early return
This commit is contained in:
parent
7d334f83cd
commit
066771e366
@ -384,6 +384,8 @@ void Act3Ammo::Animate(float p_time)
|
|||||||
m_world->RemoveDonut(*this);
|
m_world->RemoveDonut(*this);
|
||||||
m_world->TriggerHitSound(4);
|
m_world->TriggerHitSound(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (IsPizza()) {
|
if (IsPizza()) {
|
||||||
@ -394,95 +396,99 @@ void Act3Ammo::Animate(float p_time)
|
|||||||
assert(SoundManager()->GetCacheSoundManager());
|
assert(SoundManager()->GetCacheSoundManager());
|
||||||
SoundManager()->GetCacheSoundManager()->Play("stickdn", NULL, FALSE);
|
SoundManager()->GetCacheSoundManager()->Play("stickdn", NULL, FALSE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LegoPathActorSet& plpas = m_boundary->GetActors();
|
LegoPathActorSet& plpas = m_boundary->GetActors();
|
||||||
LegoPathActorSet lpas(plpas);
|
LegoPathActorSet lpas(plpas);
|
||||||
|
|
||||||
for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
|
for (LegoPathActorSet::iterator itpa = lpas.begin(); itpa != lpas.end(); itpa++) {
|
||||||
if (plpas.find(*itpa) == plpas.end()) {
|
if (plpas.find(*itpa) == plpas.end()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this == *itpa) {
|
if (this == *itpa) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
LegoROI* r = (*itpa)->GetROI();
|
LegoROI* r = (*itpa)->GetROI();
|
||||||
assert(r);
|
assert(r);
|
||||||
|
|
||||||
if (!strncmp(r->GetName(), "pammo", 5)) {
|
if (!strncmp(r->GetName(), "pammo", 5)) {
|
||||||
Mx3DPointFloat local1c8;
|
Mx3DPointFloat local1c8;
|
||||||
Mx3DPointFloat local1b4;
|
Mx3DPointFloat local1b4;
|
||||||
|
|
||||||
local1c8 = r->GetLocal2World()[3];
|
local1c8 = r->GetLocal2World()[3];
|
||||||
local1b4 = m_roi->GetLocal2World()[3];
|
local1b4 = m_roi->GetLocal2World()[3];
|
||||||
|
|
||||||
local1b4 -= local1c8;
|
local1b4 -= local1c8;
|
||||||
|
|
||||||
float radius = r->GetWorldBoundingSphere().Radius();
|
float radius = r->GetWorldBoundingSphere().Radius();
|
||||||
if (local1b4.LenSquared() <= radius * radius) {
|
if (local1b4.LenSquared() <= radius * radius) {
|
||||||
MxS32 index = -1;
|
MxS32 index = -1;
|
||||||
if (sscanf(r->GetName(), "pammo%d", &index) != 1) {
|
if (sscanf(r->GetName(), "pammo%d", &index) != 1) {
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
|
||||||
|
|
||||||
assert(m_world);
|
|
||||||
|
|
||||||
if (m_world->m_pizzas[index].IsValid() && !m_world->m_pizzas[index].IsSharkFood()) {
|
|
||||||
m_world->EatPizza(index);
|
|
||||||
m_world->m_brickster->FUN_100417c0();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsDonut()) {
|
|
||||||
assert(SoundManager()->GetCacheSoundManager());
|
|
||||||
SoundManager()->GetCacheSoundManager()->Play("dnhitpz", NULL, FALSE);
|
|
||||||
m_world->RemoveDonut(*this);
|
|
||||||
local14 = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (!strncmp(r->GetName(), "dammo", 5)) {
|
|
||||||
Mx3DPointFloat local1f8;
|
|
||||||
Mx3DPointFloat local1e4;
|
|
||||||
|
|
||||||
local1f8 = r->GetLocal2World()[3];
|
assert(m_world);
|
||||||
local1e4 = m_roi->GetLocal2World()[3];
|
|
||||||
|
|
||||||
local1e4 -= local1f8;
|
#ifdef BETA10
|
||||||
|
m_world->EatPizza(index);
|
||||||
|
#else
|
||||||
|
if (m_world->m_pizzas[index].IsValid() && !m_world->m_pizzas[index].IsSharkFood()) {
|
||||||
|
m_world->EatPizza(index);
|
||||||
|
m_world->m_brickster->FUN_100417c0();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
float radius = r->GetWorldBoundingSphere().Radius();
|
if (IsDonut()) {
|
||||||
if (local1e4.LenSquared() <= radius * radius) {
|
assert(SoundManager()->GetCacheSoundManager());
|
||||||
MxS32 index = -1;
|
SoundManager()->GetCacheSoundManager()->Play("dnhitpz", NULL, FALSE);
|
||||||
if (sscanf(r->GetName(), "dammo%d", &index) != 1) {
|
m_world->RemoveDonut(*this);
|
||||||
assert(0);
|
local14 = TRUE;
|
||||||
}
|
break;
|
||||||
|
|
||||||
assert(m_world);
|
|
||||||
|
|
||||||
m_world->EatDonut(index);
|
|
||||||
|
|
||||||
if (IsPizza()) {
|
|
||||||
assert(SoundManager()->GetCacheSoundManager());
|
|
||||||
SoundManager()->GetCacheSoundManager()->Play("pzhitdn", NULL, FALSE);
|
|
||||||
m_world->RemovePizza(*this);
|
|
||||||
local14 = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!strncmp(r->GetName(), "dammo", 5)) {
|
||||||
|
Mx3DPointFloat local1f8;
|
||||||
|
Mx3DPointFloat local1e4;
|
||||||
|
|
||||||
if (!local14) {
|
local1f8 = r->GetLocal2World()[3];
|
||||||
if (IsPizza()) {
|
local1e4 = m_roi->GetLocal2World()[3];
|
||||||
m_world->FUN_10073360(*this, local68);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_world->FUN_10073390(*this, local68);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_worldSpeed = -1.0f;
|
local1e4 -= local1f8;
|
||||||
|
|
||||||
|
float radius = r->GetWorldBoundingSphere().Radius();
|
||||||
|
if (local1e4.LenSquared() <= radius * radius) {
|
||||||
|
MxS32 index = -1;
|
||||||
|
if (sscanf(r->GetName(), "dammo%d", &index) != 1) {
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(m_world);
|
||||||
|
|
||||||
|
m_world->EatDonut(index);
|
||||||
|
|
||||||
|
if (IsPizza()) {
|
||||||
|
assert(SoundManager()->GetCacheSoundManager());
|
||||||
|
SoundManager()->GetCacheSoundManager()->Play("pzhitdn", NULL, FALSE);
|
||||||
|
m_world->RemovePizza(*this);
|
||||||
|
local14 = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!local14) {
|
||||||
|
if (IsPizza()) {
|
||||||
|
m_world->FUN_10073360(*this, local68);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_world->FUN_10073390(*this, local68);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_worldSpeed = -1.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user