Merge branch 'develop' into develop_mirrors

This commit is contained in:
Lwmte 2024-12-21 01:05:36 +01:00
commit 839f05b3d1
5 changed files with 14 additions and 15 deletions

View file

@ -35,6 +35,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
* Fixed exploding TR3 bosses.
* Fixed original issue with deactivation of Dart Emitter.
* Fixed original issue with weapon hotkeys available in binoculars or lasersight mode.
* Fixed Electricity Wires object not doing instant kill when Lara is in close proximity.
* Fixed Lens Flare object not functioning properly.
* Fixed lens flares not being occluded by static meshes and moveables.
* Fixed spotlight shadows.

View file

@ -222,7 +222,7 @@ void ElectricityWiresControl(short itemNumber)
isWaterNearby = true;
}
bool instantKill = BoundingSphere(Vector3(pos.x, pos.y, pos.z), CLICK(0.25f)).Intersects(npcBox);
bool instantKill = BoundingSphere(Vector3(pos.x, pos.y, pos.z), BLOCK(0.25f)).Intersects(npcBox);
if (isWaterNearby || instantKill)
{

View file

@ -140,7 +140,6 @@ void InitPickup(ObjectInfo* object, int objectNumber, std::function<ControlFunct
if (object->loaded)
{
object->Initialize = InitializePickup;
object->collision = PickupCollision;
object->control = (func != nullptr) ? func : PickupControl;
object->isPickup = true;
@ -156,7 +155,6 @@ void InitFlare(ObjectInfo* object, int objectNumber)
object->collision = PickupCollision;
object->control = FlareControl;
object->pivotLength = 256;
object->HitPoints = 256; // Time.
object->usingDrawAnimatingItem = false;
object->isPickup = true;
}

View file

@ -58,7 +58,7 @@ namespace TEN::Scripting
// @treturn Time A new Time object initialized with the given frame count.
Time::Time(int gameFrames)
{
_frameCount = gameFrames;
_frameCount = std::clamp(gameFrames, 0, INT_MAX);
}
/// Create a Time object from a formatted string.
@ -194,18 +194,18 @@ namespace TEN::Scripting
Time& Time::operator -=(const Time& time)
{
_frameCount -= time._frameCount;
_frameCount = std::clamp(_frameCount - time._frameCount, 0, INT_MAX);
return *this;
}
Time Time::operator +(int frameCount) const
{
return Time(frameCount + _frameCount);
return Time(_frameCount + frameCount);
}
Time Time::operator -(int frameCount) const
{
return Time(frameCount - _frameCount);
return Time(std::clamp(_frameCount - frameCount, 0, INT_MAX));
}
Time Time::operator +(const Time& time) const
@ -215,17 +215,17 @@ namespace TEN::Scripting
Time Time::operator -(const Time& time) const
{
return Time(_frameCount - time._frameCount);
return Time(std::clamp(_frameCount - time._frameCount, 0, INT_MAX));
}
Time Time::operator <(const Time& time) const
bool Time::operator <(const Time& time) const
{
return Time(_frameCount < time._frameCount);
return _frameCount < time._frameCount;
}
Time Time::operator <=(const Time& time) const
bool Time::operator <=(const Time& time) const
{
return Time(_frameCount <= time._frameCount);
return _frameCount <= time._frameCount;
}
bool Time::operator ==(const Time& time) const

View file

@ -42,13 +42,13 @@ namespace TEN::Scripting
// Operators
bool operator <(const Time& time) const;
bool operator <=(const Time& time) const;
bool operator ==(const Time& time) const;
Time operator +(int frameCount) const;
Time operator -(int frameCount) const;
Time operator +(const Time& time) const;
Time operator -(const Time& time) const;
Time operator <(const Time& time) const;
Time operator <=(const Time& time) const;
bool operator ==(const Time& time) const;
Time& operator +=(const Time& time);
Time& operator -=(const Time& time);
Time& Time::operator ++();