mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-02 17:57:59 +03:00
Added height check to expanding_platform based on its animation
This commit is contained in:
parent
d83cd56a50
commit
b9e9971a35
4 changed files with 33 additions and 31 deletions
|
@ -37,26 +37,6 @@ void ControlExpandingPlatform(short itemNumber)
|
|||
{
|
||||
if (!item->itemFlags[2])
|
||||
{
|
||||
if (item->objectNumber == ID_RAISING_BLOCK1)
|
||||
{
|
||||
if (item->triggerFlags == -1)
|
||||
{
|
||||
//AlterFloorHeight(item, -255);
|
||||
}
|
||||
else if (item->triggerFlags == -3)
|
||||
{
|
||||
//AlterFloorHeight(item, -1023);
|
||||
}
|
||||
else
|
||||
{
|
||||
//AlterFloorHeight(item, -item->itemFlags[7]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//AlterFloorHeight(item, -item->itemFlags[7]);
|
||||
}
|
||||
|
||||
item->itemFlags[2] = 1;
|
||||
}
|
||||
|
||||
|
@ -94,22 +74,12 @@ void ControlExpandingPlatform(short itemNumber)
|
|||
{
|
||||
if (item->triggerFlags == -1)
|
||||
{
|
||||
//AlterFloorHeight(item, 255);
|
||||
item->itemFlags[2] = 0;
|
||||
}
|
||||
else if (item->triggerFlags == -3)
|
||||
{
|
||||
//AlterFloorHeight(item, 1023);
|
||||
item->itemFlags[2] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//AlterFloorHeight(item, item->itemFlags[7]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//AlterFloorHeight(item, item->itemFlags[7]);
|
||||
}
|
||||
|
||||
item->itemFlags[2] = 0;
|
||||
|
@ -139,7 +109,31 @@ void ControlExpandingPlatform(short itemNumber)
|
|||
std::optional<int> ExpandingPlatformFloor(short itemNumber, int x, int y, int z)
|
||||
{
|
||||
const auto& item = g_Level.Items[itemNumber];
|
||||
const auto height = item.pos.yPos + CLICK(2) - item.itemFlags[7] * (item.itemFlags[1] > 0 ? 1 : 0);
|
||||
if (item.itemFlags[1] <= 0)
|
||||
return std::nullopt;
|
||||
if (item.pos.yRot == ANGLE(90))
|
||||
{
|
||||
auto xBorder = item.pos.xPos + CLICK(2) - SECTOR(1) * item.itemFlags[1] / 4096;
|
||||
if(x < xBorder)
|
||||
return std::nullopt;
|
||||
} else if (item.pos.yRot == ANGLE(270))
|
||||
{
|
||||
auto xBorder = item.pos.xPos - CLICK(2) + SECTOR(1) * item.itemFlags[1] / 4096;
|
||||
if (x > xBorder)
|
||||
return std::nullopt;
|
||||
} else if (item.pos.yRot == 0)
|
||||
{
|
||||
auto zBorder = item.pos.zPos + CLICK(2) - SECTOR(1) * item.itemFlags[1] / 4096;
|
||||
if (z < zBorder)
|
||||
return std::nullopt;
|
||||
}
|
||||
else if (item.pos.yRot == ANGLE(180))
|
||||
{
|
||||
auto zBorder = item.pos.zPos - CLICK(2) + SECTOR(1) * item.itemFlags[1] / 4096;
|
||||
if (z > zBorder)
|
||||
return std::nullopt;
|
||||
}
|
||||
const auto height = item.pos.yPos - item.itemFlags[7] + CLICK(2);
|
||||
return std::optional{ height };
|
||||
}
|
||||
|
|
@ -450,6 +450,7 @@ xcopy /Y "$(ProjectDir)Scripting\Scripts\*.lua" "$(TargetDir)\Scripts"</Command>
|
|||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="Objects\TR5\Object\tr5_genslot.h" />
|
||||
<ClInclude Include="Renderer\VertexBuffer\VertexBuffer.h" />
|
||||
<ClInclude Include="Objects\TR5\Object\tr5_expandingplatform.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="framework.cpp">
|
||||
|
@ -727,6 +728,7 @@ xcopy /Y "$(ProjectDir)Scripting\Scripts\*.lua" "$(TargetDir)\Scripts"</Command>
|
|||
<ClCompile Include="Specific\winmain.cpp" />
|
||||
<ClCompile Include="Objects\TR5\Object\tr5_genslot.cpp" />
|
||||
<ClCompile Include="Renderer\VertexBuffer\VertexBuffer.cpp" />
|
||||
<ClCompile Include="Objects\TR5\Object\tr5_expandingplatform.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Objects\Effects\tr4_bubbles.cpp" />
|
||||
|
|
|
@ -960,6 +960,9 @@
|
|||
<ClInclude Include="Objects\TR4\Object\tr4_obelisk.h">
|
||||
<Filter>File di intestazione</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Objects\TR5\Object\tr5_expandingplatform.h">
|
||||
<Filter>File di intestazione</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Game\box.cpp">
|
||||
|
@ -1766,6 +1769,9 @@
|
|||
<ClCompile Include="Objects\TR4\Object\tr4_obelisk.cpp">
|
||||
<Filter>File di origine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Objects\TR5\Object\tr5_expandingplatform.cpp">
|
||||
<Filter>File di origine</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue