mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-03 10:17:59 +03:00
Fix UPV bugs
This commit is contained in:
parent
5355bf3983
commit
35d736421c
3 changed files with 21 additions and 16 deletions
|
@ -105,7 +105,7 @@ bool GetCollidedObjects(ITEM_INFO* collidingItem, int radius, int onlyVisible, I
|
||||||
}
|
}
|
||||||
|
|
||||||
/*this is awful*/
|
/*this is awful*/
|
||||||
/*if (item->objectNumber == ID_UPV && item->hitPoints == 1)
|
if (item->objectNumber == ID_UPV && item->hitPoints == 1)
|
||||||
{
|
{
|
||||||
itemNumber = item->nextItem;
|
itemNumber = item->nextItem;
|
||||||
continue;
|
continue;
|
||||||
|
@ -114,7 +114,7 @@ bool GetCollidedObjects(ITEM_INFO* collidingItem, int radius, int onlyVisible, I
|
||||||
{
|
{
|
||||||
itemNumber = item->nextItem;
|
itemNumber = item->nextItem;
|
||||||
continue;
|
continue;
|
||||||
}*/
|
}
|
||||||
/*we need a better system*/
|
/*we need a better system*/
|
||||||
|
|
||||||
int dx = collidingItem->pos.xPos - item->pos.xPos;
|
int dx = collidingItem->pos.xPos - item->pos.xPos;
|
||||||
|
|
|
@ -228,16 +228,20 @@ void HairControl(int cutscene, int ponytail, ANIM_FRAME* framePtr)
|
||||||
Hairs[ponytail][i].pos.yPos += Hairs[ponytail][i].hvel.y * 3 / 4;
|
Hairs[ponytail][i].pos.yPos += Hairs[ponytail][i].hvel.y * 3 / 4;
|
||||||
Hairs[ponytail][i].pos.zPos += Hairs[ponytail][i].hvel.z * 3 / 4;
|
Hairs[ponytail][i].pos.zPos += Hairs[ponytail][i].hvel.z * 3 / 4;
|
||||||
|
|
||||||
if (Lara.waterStatus == LW_ABOVE_WATER && g_Level.Rooms[roomNumber].flags & ENV_FLAG_WIND)
|
// TR3 UPV uses a hack which forces Lara water status to dry.
|
||||||
{
|
// Therefore, we can't directly use water status value to determine hair mode.
|
||||||
Hairs[ponytail][i].pos.xPos += Weather.Wind().x * 2.0f;
|
bool dryMode = (Lara.waterStatus == LW_ABOVE_WATER) && (Lara.Vehicle == -1 || g_Level.Items[Lara.Vehicle].objectNumber != ID_UPV);
|
||||||
Hairs[ponytail][i].pos.zPos += Weather.Wind().z * 2.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (Lara.waterStatus)
|
if (dryMode)
|
||||||
{
|
{
|
||||||
case LW_ABOVE_WATER:
|
if (g_Level.Rooms[roomNumber].flags & ENV_FLAG_WIND)
|
||||||
|
{
|
||||||
|
Hairs[ponytail][i].pos.xPos += Weather.Wind().x * 2.0f;
|
||||||
|
Hairs[ponytail][i].pos.zPos += Weather.Wind().z * 2.0f;
|
||||||
|
}
|
||||||
|
|
||||||
Hairs[ponytail][i].pos.yPos += 10;
|
Hairs[ponytail][i].pos.yPos += 10;
|
||||||
|
|
||||||
if (wh != NO_HEIGHT && Hairs[ponytail][i].pos.yPos > wh)
|
if (wh != NO_HEIGHT && Hairs[ponytail][i].pos.yPos > wh)
|
||||||
{
|
{
|
||||||
Hairs[ponytail][i].pos.yPos = wh;
|
Hairs[ponytail][i].pos.yPos = wh;
|
||||||
|
@ -247,16 +251,13 @@ void HairControl(int cutscene, int ponytail, ANIM_FRAME* framePtr)
|
||||||
Hairs[ponytail][i].pos.xPos = Hairs[ponytail][0].hvel.x;
|
Hairs[ponytail][i].pos.xPos = Hairs[ponytail][0].hvel.x;
|
||||||
Hairs[ponytail][i].pos.zPos = Hairs[ponytail][0].hvel.z;
|
Hairs[ponytail][i].pos.zPos = Hairs[ponytail][0].hvel.z;
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
else
|
||||||
case LW_UNDERWATER:
|
{
|
||||||
case LW_SURFACE:
|
|
||||||
case LW_WADE:
|
|
||||||
if (Hairs[ponytail][i].pos.yPos < wh)
|
if (Hairs[ponytail][i].pos.yPos < wh)
|
||||||
Hairs[ponytail][i].pos.yPos = wh;
|
Hairs[ponytail][i].pos.yPos = wh;
|
||||||
else if (Hairs[ponytail][i].pos.yPos > height)
|
else if (Hairs[ponytail][i].pos.yPos > height)
|
||||||
Hairs[ponytail][i].pos.yPos = height;
|
Hairs[ponytail][i].pos.yPos = height;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < HAIR_SPHERE; j++)
|
for (int j = 0; j < HAIR_SPHERE; j++)
|
||||||
|
|
|
@ -886,7 +886,7 @@ void SubCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
||||||
l->pos.yRot = v->pos.yRot;
|
l->pos.yRot = v->pos.yRot;
|
||||||
l->pos.zRot = v->pos.zRot;
|
l->pos.zRot = v->pos.zRot;
|
||||||
|
|
||||||
if (Lara.waterStatus == LW_SURFACE)
|
if (l->currentAnimState == LS_ONWATER_STOP || l->currentAnimState == LS_ONWATER_FORWARD)
|
||||||
{
|
{
|
||||||
l->animNumber = Objects[ID_UPV_LARA_ANIMS].animIndex + SUB_GETONSURF_A;
|
l->animNumber = Objects[ID_UPV_LARA_ANIMS].animIndex + SUB_GETONSURF_A;
|
||||||
l->frameNumber = GF2(ID_UPV_LARA_ANIMS, SUB_GETONSURF_A, 0);
|
l->frameNumber = GF2(ID_UPV_LARA_ANIMS, SUB_GETONSURF_A, 0);
|
||||||
|
@ -1033,6 +1033,10 @@ int SubControl(void)
|
||||||
l->pos.yRot = v->pos.yRot;
|
l->pos.yRot = v->pos.yRot;
|
||||||
l->pos.zRot = v->pos.zRot;
|
l->pos.zRot = v->pos.zRot;
|
||||||
|
|
||||||
|
// HACK: location is only updated for Lara! Never for other objects!
|
||||||
|
// This is a fundamental architectural overlook.
|
||||||
|
v->location = l->location;
|
||||||
|
|
||||||
AnimateItem(l);
|
AnimateItem(l);
|
||||||
BackgroundCollision(v, l, sub);
|
BackgroundCollision(v, l, sub);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue