diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-20 19:40:36 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-20 19:40:36 +0200 |
commit | f33a01e8c8db821b5c6457715f98aa8762d00167 (patch) | |
tree | 9a41c75660aac8e6dd6be8fa24e4b61fb05e0e23 /src/core/World.cpp | |
parent | script revision (diff) | |
parent | Merge remote-tracking branch 'origin/master' into miami (diff) | |
download | re3-f33a01e8c8db821b5c6457715f98aa8762d00167.tar re3-f33a01e8c8db821b5c6457715f98aa8762d00167.tar.gz re3-f33a01e8c8db821b5c6457715f98aa8762d00167.tar.bz2 re3-f33a01e8c8db821b5c6457715f98aa8762d00167.tar.lz re3-f33a01e8c8db821b5c6457715f98aa8762d00167.tar.xz re3-f33a01e8c8db821b5c6457715f98aa8762d00167.tar.zst re3-f33a01e8c8db821b5c6457715f98aa8762d00167.zip |
Diffstat (limited to 'src/core/World.cpp')
-rw-r--r-- | src/core/World.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/core/World.cpp b/src/core/World.cpp index f6817f8b..16e5e80d 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -1813,18 +1813,22 @@ void CWorld::RepositionOneObject(CEntity *pEntity) { int16 modelId = pEntity->GetModelIndex(); - if (IsTrafficLight(modelId) || IsTreeModel(modelId) || modelId == MI_PARKINGMETER || - modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN || modelId == MI_BIN || modelId == MI_POSTBOX1 || - modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE || modelId == MI_DUMP1 || - modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 || - modelId == MI_PHONESIGN || modelId == MI_TAXISIGN || modelId == MI_FISHSTALL01 || - modelId == MI_FISHSTALL02 || modelId == MI_FISHSTALL03 || modelId == MI_FISHSTALL04 || - modelId == MI_BAGELSTAND2 || modelId == MI_FIRE_HYDRANT || modelId == MI_BOLLARDLIGHT || - modelId == MI_PARKTABLE) { + if (modelId == MI_PARKINGMETER || modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN || + modelId == MI_BIN || modelId == MI_POSTBOX1 || modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE || + modelId == MI_DUMP1 || modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 || + modelId == MI_PHONESIGN || modelId == MI_FIRE_HYDRANT || modelId == MI_BOLLARDLIGHT || + modelId == MI_PARKTABLE || modelId == MI_PARKINGMETER2 || modelId == MI_TELPOLE02 || + modelId == MI_PARKBENCH || modelId == MI_BARRIER1 || IsTreeModel(modelId) +// TODO(MIAMI): this is actually a different case +|| IsStreetLight(modelId) + ) { CVector &position = pEntity->GetMatrix().GetPosition(); - float fBoundingBoxMinZ = pEntity->GetColModel()->boundingBox.min.z; + CColModel *pColModel = pEntity->GetColModel(); + float fBoundingBoxMinZ = pColModel->boundingBox.min.z; + float fHeight = pColModel->boundingBox.max.z - pColModel->boundingBox.min.z; + if(fHeight < OBJECT_REPOSITION_OFFSET_Z) fHeight = OBJECT_REPOSITION_OFFSET_Z; position.z = CWorld::FindGroundZFor3DCoord(position.x, position.y, - position.z + OBJECT_REPOSITION_OFFSET_Z, nil) - + position.z + fHeight, nil) - fBoundingBoxMinZ; pEntity->m_matrix.UpdateRW(); pEntity->UpdateRwFrame(); |