forked from Mirrors/openclonk
Fix engine internal smoke.
Smoke() used to create a Smoke particle directly, but the particle definitions changed. Now it just calls the global script function to create smoke.stable-5.4
parent
dd3de2f0c9
commit
8d1fbd1401
|
@ -627,9 +627,8 @@ void Splash(int32_t tx, int32_t ty, int32_t amt, C4Object *pByObj)
|
|||
|
||||
void Smoke(int32_t tx, int32_t ty, int32_t level, DWORD dwClr)
|
||||
{
|
||||
if (::Particles.pSmoke)
|
||||
{
|
||||
::Particles.Create(::Particles.pSmoke, float(tx), float(ty)-level/2, 0.0f, 0.0f, float(level), dwClr);
|
||||
return;
|
||||
}
|
||||
// Use scripted function (global func Smoke) to create smoke
|
||||
// Caution: This makes engine internal smoking a synced call.
|
||||
C4AulParSet pars(C4VInt(tx), C4VInt(ty), C4VInt(level), C4VInt(dwClr));
|
||||
::ScriptEngine.GetPropList()->Call(P_Smoke, &pars);
|
||||
}
|
||||
|
|
|
@ -325,13 +325,6 @@ static C4Value FnFindObjects(C4PropList * _this, C4Value *pPars)
|
|||
return C4VArray(pResult);
|
||||
}
|
||||
|
||||
static bool FnSmoke(C4PropList * _this, long tx, long ty, long level, long dwClr)
|
||||
{
|
||||
if (Object(_this)) { tx+=Object(_this)->GetX(); ty+=Object(_this)->GetY(); }
|
||||
Smoke(tx,ty,level,dwClr);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool FnInsertMaterial(C4PropList * _this, long mat, long x, long y, long vx, long vy, C4PropList *insert_position)
|
||||
{
|
||||
if (Object(_this)) { x+=Object(_this)->GetX(); y+=Object(_this)->GetY(); }
|
||||
|
@ -2434,7 +2427,6 @@ void InitGameFunctionMap(C4AulScriptEngine *pEngine)
|
|||
new C4AulDefFunc(pEngine, pDef);
|
||||
#define F(f) AddFunc(pEngine, #f, Fn##f)
|
||||
// AddFunc(pEngine, "SetSaturation", FnSetSaturation); //public: 0
|
||||
AddFunc(pEngine, "Smoke", FnSmoke);
|
||||
|
||||
AddFunc(pEngine, "GetX", FnGetX);
|
||||
AddFunc(pEngine, "GetY", FnGetY);
|
||||
|
|
|
@ -184,6 +184,7 @@ C4StringTable::C4StringTable()
|
|||
P[P_CollisionVertex] = "CollisionVertex";
|
||||
P[P_OnCollision] = "OnCollision";
|
||||
P[P_Distance] = "Distance";
|
||||
P[P_Smoke] = "Smoke";
|
||||
P[DFA_WALK] = "WALK";
|
||||
P[DFA_FLIGHT] = "FLIGHT";
|
||||
P[DFA_KNEEL] = "KNEEL";
|
||||
|
|
|
@ -391,6 +391,7 @@ enum C4PropertyName
|
|||
P_CollisionVertex,
|
||||
P_OnCollision,
|
||||
P_Distance,
|
||||
P_Smoke,
|
||||
// Default Action Procedures
|
||||
DFA_WALK,
|
||||
DFA_FLIGHT,
|
||||
|
|
Loading…
Reference in New Issue