mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 17:46:53 -10:00
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.
28 lines
373 B
C++
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*);
|
|
|
|
}
|
|
}
|
|
|