mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-02 17:57: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*/
|
||||
/*if (item->objectNumber == ID_UPV && item->hitPoints == 1)
|
||||
if (item->objectNumber == ID_UPV && item->hitPoints == 1)
|
||||
{
|
||||
itemNumber = item->nextItem;
|
||||
continue;
|
||||
|
@ -114,7 +114,7 @@ bool GetCollidedObjects(ITEM_INFO* collidingItem, int radius, int onlyVisible, I
|
|||
{
|
||||
itemNumber = item->nextItem;
|
||||
continue;
|
||||
}*/
|
||||
}
|
||||
/*we need a better system*/
|
||||
|
||||
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.zPos += Hairs[ponytail][i].hvel.z * 3 / 4;
|
||||
|
||||
if (Lara.waterStatus == LW_ABOVE_WATER && 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;
|
||||
}
|
||||
// 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.
|
||||
bool dryMode = (Lara.waterStatus == LW_ABOVE_WATER) && (Lara.Vehicle == -1 || g_Level.Items[Lara.Vehicle].objectNumber != ID_UPV);
|
||||
|
||||
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;
|
||||
|
||||
if (wh != NO_HEIGHT && 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.zPos = Hairs[ponytail][0].hvel.z;
|
||||
}
|
||||
break;
|
||||
|
||||
case LW_UNDERWATER:
|
||||
case LW_SURFACE:
|
||||
case LW_WADE:
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Hairs[ponytail][i].pos.yPos < wh)
|
||||
Hairs[ponytail][i].pos.yPos = wh;
|
||||
else if (Hairs[ponytail][i].pos.yPos > height)
|
||||
Hairs[ponytail][i].pos.yPos = height;
|
||||
break;
|
||||
}
|
||||
|
||||
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.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->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.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);
|
||||
BackgroundCollision(v, l, sub);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue