mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-16 01:54:38 +02:00
#3 fix collisions check with enemies
This commit is contained in:
@@ -1171,7 +1171,6 @@ struct Lara : Character {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
int room = getRoomIndex();
|
int room = getRoomIndex();
|
||||||
TR::Entity &e = getEntity();
|
|
||||||
TR::Limits::Limit limit = state == STATE_STOP ? TR::Limits::PICKUP : TR::Limits::PICKUP_UNDERWATER;
|
TR::Limits::Limit limit = state == STATE_STOP ? TR::Limits::PICKUP : TR::Limits::PICKUP_UNDERWATER;
|
||||||
|
|
||||||
for (int i = 0; i < level->entitiesCount; i++) {
|
for (int i = 0; i < level->entitiesCount; i++) {
|
||||||
@@ -1490,8 +1489,6 @@ struct Lara : Character {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Block* getBlock() {
|
Block* getBlock() {
|
||||||
int y = int(pos.y);
|
|
||||||
|
|
||||||
for (int i = 0; i < level->entitiesCount; i++) {
|
for (int i = 0; i < level->entitiesCount; i++) {
|
||||||
TR::Entity &e = level->entities[i];
|
TR::Entity &e = level->entities[i];
|
||||||
if (!e.isBlock())
|
if (!e.isBlock())
|
||||||
@@ -2004,7 +2001,7 @@ struct Lara : Character {
|
|||||||
Character *enemy = (Character*)e.controller;
|
Character *enemy = (Character*)e.controller;
|
||||||
if (enemy->health <= 0) continue;
|
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);
|
vec3 p = dir.rotateY(-enemy->angle.y);
|
||||||
|
|
||||||
Box enemyBox = enemy->getBoundingBoxLocal();
|
Box enemyBox = enemy->getBoundingBoxLocal();
|
||||||
|
Reference in New Issue
Block a user