Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Doors located within change terrain tiles are created at the height o…
Browse files Browse the repository at this point in the history
…f the change terrain trap.

Max height of a change terrain trap is capped at 96 units.
  • Loading branch information
hankmorgan committed Dec 30, 2015
1 parent dc9c0cf commit d398b66
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
10 changes: 1 addition & 9 deletions Unity.cpp
Expand Up @@ -499,14 +499,6 @@ void RenderUnityEntityDoor(int game, float x, float y, float z, ObjectItem &curr
}
}
}

/*
if ((currobj.link != 0) || (currobj.SHOCKLocked >0))
{
//if it has a lock it needs a lock object for scripting purposes
RenderUnityEntity(game, x, y, z, objList[currobj.link],objList,LevelInfo);
}
*/
return;
}

Expand Down Expand Up @@ -2260,7 +2252,7 @@ float offX; float offY; float offZ;
long nextObj = LevelInfo[x][y].indexObjectList;
while (nextObj != 0)
{
if (nextObj == 869)

//objList[nextObj].tileX = x;//Set the tile X and Y of the object. This is usefull to know.
//objList[nextObj].tileY = y;
offX = 0.0; offY = 0.0; offZ = 0.0;
Expand Down
7 changes: 6 additions & 1 deletion gameobjects.cpp
Expand Up @@ -653,6 +653,7 @@ switch (game)
{
objList[x].texture = texture_map[objList[x].owner]; //Sets the texture for tmap objects. I won't have access to the texture map later on.
}

if (objectMasters[objList[x].item_id].type == DOOR)
{
switch (game)
Expand Down Expand Up @@ -742,7 +743,11 @@ switch (game)
{
objList[x].texture = texture_map[(textureQuality)+48];
}

if (objList[x].zpos > 96)
{
//cap the zpos height at this
objList[x].zpos = 96;
}


}
Expand Down
2 changes: 0 additions & 2 deletions gameobjectsrender.cpp
Expand Up @@ -42,7 +42,6 @@ void CalcObjectXYZ(int game, float *offX, float *offY, float *offZ, tile LevelIn

*offX = 0; *offY = 0; *offZ = 0;


float BrushX = BrushSizeX;
float BrushY = BrushSizeY;
float BrushZ = BrushSizeZ;
Expand All @@ -68,7 +67,6 @@ void CalcObjectXYZ(int game, float *offX, float *offY, float *offZ, tile LevelIn
if (game == SHOCK){ ResolutionXY = 256.0; ResolutionZ = 256.0; } //Shock has more "z" in it.

*offX = 0; *offY = 0; *offZ = 0;

float BrushX = BrushSizeX;
float BrushY = BrushSizeY;
float BrushZ = BrushSizeZ;
Expand Down
4 changes: 4 additions & 0 deletions tilemap.cpp
Expand Up @@ -1500,6 +1500,10 @@ for (int x=0; x<64;x++)
LevelInfo[j][k].TerrainChangeIndices[LevelInfo[j][k].TerrainChangeCount]=currObj.index;
LevelInfo[j][k].TerrainChangeCount++;
//LevelInfo[j][k].isWater = 0;// turn off water in terrain change tiles
if (LevelInfo[j][k].isDoor==1)//The tile contains a door. I need to make sure the door is created at the height of the tile.
{
objList[LevelInfo[j][k].DoorIndex].zpos = objList[currObj.index].zpos;
}
}
}
currObj.tileX=x;
Expand Down

0 comments on commit d398b66

Please sign in to comment.