Files
fs2open.github.com/code/scripting/api/objs/particle.h
T
asarium 772a02f56f Disallow to use non-trivial types as scripting handles
As described in #1278, the current scripting system has issues with
handling non-trivial C++ types. Since fixing that deficiency is too much
work, especially since we are in a feature freeze, I decided to simply
enforce the usage of trivial types for scripting handles. Fortunately,
only two handles used non-trivial types so it was relatively easy to fix
those instances by dynamically allocating those and only storing the
pointers in the lua memory.

This fixes a bug in JAD-XA where the game would crash at the last boss.

Also, I noticed that the HudGauge handle used a copy of the hud gauge
rather than a pointer to the actual instance so I'm pretty sure that any
scripting changes to a custom HUD gauge simply didn't work before.
2017-03-04 16:16:22 +01:00

28 lines
373 B
C++

#pragma once
#include "scripting/ade_api.h"
#include "particle/particle.h"
namespace scripting {
namespace api {
class particle_h
{
protected:
particle::WeakParticlePtr part;
public:
particle_h();
explicit particle_h(const particle::WeakParticlePtr& part_p);
particle::WeakParticlePtr Get();
bool isValid();
};
DECLARE_ADE_OBJ(l_Particle, particle_h*);
}
}