From 9582dfd502cdd56a374815677f292d3a950236e9 Mon Sep 17 00:00:00 2001 From: XProger Date: Tue, 4 Dec 2018 05:49:26 +0300 Subject: [PATCH] merge, fix emscripten webassembly compiler bug, fix limited pistols ammo on LEVEL10A bug --- src/controller.h | 2 +- src/inventory.h | 7 +++---- src/lara.h | 2 +- src/trigger.h | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/controller.h b/src/controller.h index 90e6991..b8338ce 100644 --- a/src/controller.h +++ b/src/controller.h @@ -1466,7 +1466,7 @@ struct Controller { mask |= layers[i].mask; // set meshes visibility for (int j = 0; j < model->mCount; j++) - joints[j].w = (vmask & (1 << j)) ? 1.0f : 0.0f; // hide invisible parts + joints[j].w = (vmask & (1 << j)) ? 1.0f : -1.0f; // hide invisible parts if (explodeMask) { ASSERT(explodeParts); diff --git a/src/inventory.h b/src/inventory.h index b8a437c..724792a 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -727,12 +727,11 @@ struct Inventory { if (smart) { switch (type) { case TR::Entity::INV_PISTOLS : - case TR::Entity::INV_AMMO_PISTOLS : - count = UNLIMITED_AMMO; // pistols always has unlimited ammo + case TR::Entity::INV_AMMO_PISTOLS : addAmmo(type, count, 10, TR::Entity::INV_PISTOLS, TR::Entity::INV_AMMO_PISTOLS); break; case TR::Entity::INV_SHOTGUN : - case TR::Entity::INV_AMMO_SHOTGUN : + case TR::Entity::INV_AMMO_SHOTGUN : addAmmo(type, count, 2, TR::Entity::INV_SHOTGUN, TR::Entity::INV_AMMO_SHOTGUN); break; case TR::Entity::INV_MAGNUMS : @@ -740,7 +739,7 @@ struct Inventory { addAmmo(type, count, 25, TR::Entity::INV_MAGNUMS, TR::Entity::INV_AMMO_MAGNUMS); break; case TR::Entity::INV_UZIS : - case TR::Entity::INV_AMMO_UZIS : + case TR::Entity::INV_AMMO_UZIS : addAmmo(type, count, 50, TR::Entity::INV_UZIS, TR::Entity::INV_AMMO_UZIS); break; default : ; diff --git a/src/lara.h b/src/lara.h index a90cda0..b9f5f9f 100644 --- a/src/lara.h +++ b/src/lara.h @@ -1673,7 +1673,7 @@ struct Lara : Character { if (hitType == TR::HIT_LAVA) { for (int i = 0; i < 10; i++) - Flame::add(game, this, rand() % getModel()->mCount); + Flame::add(game, this, int(randf() * 24.0f)); } if (state != oldState) diff --git a/src/trigger.h b/src/trigger.h index 7ff90c3..8cc76a0 100644 --- a/src/trigger.h +++ b/src/trigger.h @@ -145,8 +145,7 @@ struct Flame : Sprite { if (flame) { flame->owner = owner; - flame->jointIndex = jCount > 1 ? jointIndex : -1; - ASSERT(flame->jointIndex < jCount); + flame->jointIndex = jCount > 1 ? (jointIndex % jCount) : -1; } return flame; }