1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-13 08:34:32 +02:00

#3 fix collisions check with enemies

This commit is contained in:
XProger
2017-05-13 16:07:33 +03:00
parent 87b32cdf1a
commit e4fe64d754

View File

@@ -1171,7 +1171,6 @@ struct Lara : Character {
return false;
int room = getRoomIndex();
TR::Entity &e = getEntity();
TR::Limits::Limit limit = state == STATE_STOP ? TR::Limits::PICKUP : TR::Limits::PICKUP_UNDERWATER;
for (int i = 0; i < level->entitiesCount; i++) {
@@ -1490,8 +1489,6 @@ struct Lara : Character {
}
Block* getBlock() {
int y = int(pos.y);
for (int i = 0; i < level->entitiesCount; i++) {
TR::Entity &e = level->entities[i];
if (!e.isBlock())
@@ -2004,7 +2001,7 @@ struct Lara : Character {
Character *enemy = (Character*)e.controller;
if (enemy->health <= 0) continue;
vec3 dir = pos - enemy->pos;
vec3 dir = pos - vec3(0.0f, 128.0f, 0.0f) - enemy->pos;
vec3 p = dir.rotateY(-enemy->angle.y);
Box enemyBox = enemy->getBoundingBoxLocal();