summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-01-01 21:55:01 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-01-01 21:55:01 +0100
commit42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96 (patch)
tree3a9d0420a04b640e4fa4083302cc56fc09d69011
parentMerge remote-tracking branch 'upstream/master' into script_dev (diff)
downloadre3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.gz
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.bz2
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.lz
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.xz
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.zst
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.zip
-rw-r--r--src/control/Script.cpp8
-rw-r--r--src/core/ZoneCull.cpp6
-rw-r--r--src/objects/Object.cpp2
-rw-r--r--src/objects/Object.h2
-rw-r--r--src/vehicles/Automobile.cpp2
5 files changed, 13 insertions, 7 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index b3021094..d1e0f048 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -2544,7 +2544,7 @@ int8 CRunningScript::ProcessCommandsFrom200To299(int32 command)
{
CollectParameters(&m_nIp, 4);
int mi = ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::UsedObjectArray[-ScriptParams[0]].index;
- CObject* pObj = new CObject(mi, 0);
+ CObject* pObj = new CObject(mi, false);
pObj->ObjectCreatedBy = MISSION_OBJECT;
CVector pos = *(CVector*)&ScriptParams[1];
if (pos.z <= -100.0f)
@@ -5305,8 +5305,8 @@ int8 CRunningScript::ProcessCommandsFrom600To699(int32 command)
{
CollectParameters(&m_nIp, 4);
int mi = ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::UsedObjectArray[-ScriptParams[0]].index;
- CObject* pObj = new CObject(mi, 0);
- pObj->ObjectCreatedBy = MISSION_OBJECT;
+ CObject* pObj = new CObject(mi, false);
+; pObj->ObjectCreatedBy = MISSION_OBJECT;
CVector pos = *(CVector*)&ScriptParams[1];
if (pos.z <= -100.0f)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
@@ -5380,7 +5380,7 @@ int8 CRunningScript::ProcessCommandsFrom600To699(int32 command)
case COMMAND_ADD_PARTICLE_EFFECT:
{
CollectParameters(&m_nIp, 5);
- CVector pos = *(CVector*)&ScriptParams[0];
+ CVector pos = *(CVector*)&ScriptParams[1];
if (pos.z <= 100.0f)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
CParticleObject::AddObject(ScriptParams[0], pos, ScriptParams[4] != 0);
diff --git a/src/core/ZoneCull.cpp b/src/core/ZoneCull.cpp
index 6d33a1cf..6b04c213 100644
--- a/src/core/ZoneCull.cpp
+++ b/src/core/ZoneCull.cpp
@@ -134,14 +134,16 @@ CCullZones::FindAttributesForCoors(CVector coors, int32 *wantedLevel)
int i;
int32 attribs;
+ if (wantedLevel)
+ *wantedLevel = 0;
attribs = 0;
for(i = 0; i < NumAttributeZones; i++)
if(coors.x >= aAttributeZones[i].minx && coors.x <= aAttributeZones[i].maxx &&
coors.y >= aAttributeZones[i].miny && coors.y <= aAttributeZones[i].maxy &&
coors.z >= aAttributeZones[i].minz && coors.z <= aAttributeZones[i].maxz){
attribs |= aAttributeZones[i].attributes;
- if(wantedLevel && *wantedLevel <= aAttributeZones[i].wantedLevel)
- *wantedLevel = aAttributeZones[i].wantedLevel;
+ if(wantedLevel)
+ *wantedLevel = max(*wantedLevel, aAttributeZones[i].wantedLevel);
}
return attribs;
}
diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp
index 9d531c9c..de98a2d6 100644
--- a/src/objects/Object.cpp
+++ b/src/objects/Object.cpp
@@ -9,6 +9,8 @@
WRAPPER void CObject::ObjectDamage(float amount) { EAXJMP(0x4BB240); }
WRAPPER void CObject::DeleteAllTempObjectInArea(CVector, float) { EAXJMP(0x4BBED0); }
WRAPPER void CObject::Init(void) { EAXJMP(0x4BAEC0); }
+WRAPPER void CObject::ProcessControl(void) { EAXJMP(0x4BB040); }
+WRAPPER void CObject::Teleport(CVector) { EAXJMP(0x4BBDA0); }
int16 &CObject::nNoTempObjects = *(int16*)0x95CCA2;
int16 &CObject::nBodyCastHealth = *(int16*)0x5F7D4C; // 1000
diff --git a/src/objects/Object.h b/src/objects/Object.h
index 47af4fbf..c07bb233 100644
--- a/src/objects/Object.h
+++ b/src/objects/Object.h
@@ -71,6 +71,8 @@ public:
CObject(int32, bool);
~CObject(void);
+ void ProcessControl(void);
+ void Teleport(CVector);
void Render(void);
bool SetupLighting(void);
void RemoveLighting(bool reset);
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index cfcfcf65..ddb75d84 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -1090,7 +1090,7 @@ CAutomobile::ProcessControl(void)
if(m_bSirenOrAlarm && (CTimer::GetFrameCounter()&7) == 5 &&
- UsesSiren(GetModelIndex()) && GetModelIndex() != MI_RCBANDIT)
+ UsesSiren(GetModelIndex()) && GetModelIndex() != MI_MRWHOOP)
CCarAI::MakeWayForCarWithSiren(this);