Splash was broken and destructor needs to cleanup more
This commit is contained in:
parent
666333b4a1
commit
26bab8548c
|
@ -24,11 +24,6 @@ ProjectileType::ProjectileType() {
|
||||||
projectileParticleSystemType=NULL;
|
projectileParticleSystemType=NULL;
|
||||||
attackStartTime=0.0f;
|
attackStartTime=0.0f;
|
||||||
|
|
||||||
splash=false;
|
|
||||||
splashRadius=0;
|
|
||||||
splashDamageAll=true;
|
|
||||||
splashParticleSystemType=NULL;
|
|
||||||
|
|
||||||
shake=false;
|
shake=false;
|
||||||
shakeIntensity=0;
|
shakeIntensity=0;
|
||||||
shakeDuration=0;
|
shakeDuration=0;
|
||||||
|
@ -39,6 +34,13 @@ ProjectileType::ProjectileType() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProjectileType::~ProjectileType() {
|
||||||
|
deleteValues(hitSounds.getSounds().begin(), hitSounds.getSounds().end());
|
||||||
|
if(projectileParticleSystemType!=NULL){
|
||||||
|
delete projectileParticleSystemType;
|
||||||
|
projectileParticleSystemType = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ProjectileType::load(const XmlNode *projectileNode, const string &dir, const string &techtreepath, std::map<string,vector<pair<string, string> > > &loadedFileList,
|
void ProjectileType::load(const XmlNode *projectileNode, const string &dir, const string &techtreepath, std::map<string,vector<pair<string, string> > > &loadedFileList,
|
||||||
string parentLoader){
|
string parentLoader){
|
||||||
|
|
|
@ -41,11 +41,6 @@ protected:
|
||||||
SoundContainer hitSounds;
|
SoundContainer hitSounds;
|
||||||
float attackStartTime;
|
float attackStartTime;
|
||||||
|
|
||||||
bool splash;
|
|
||||||
int splashRadius;
|
|
||||||
bool splashDamageAll;
|
|
||||||
ParticleSystemTypeSplash* splashParticleSystemType;
|
|
||||||
|
|
||||||
bool shake;
|
bool shake;
|
||||||
int shakeIntensity;
|
int shakeIntensity;
|
||||||
int shakeDuration;
|
int shakeDuration;
|
||||||
|
@ -56,7 +51,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProjectileType();
|
ProjectileType();
|
||||||
virtual ~ProjectileType(){};
|
virtual ~ProjectileType();
|
||||||
|
|
||||||
|
|
||||||
void load(const XmlNode *projectileNode, const string &dir, const string &techtreepath, std::map<string,vector<pair<string, string> > > &loadedFileList,
|
void load(const XmlNode *projectileNode, const string &dir, const string &techtreepath, std::map<string,vector<pair<string, string> > > &loadedFileList,
|
||||||
|
@ -67,10 +62,6 @@ public:
|
||||||
ParticleSystemTypeProjectile* getProjectileParticleSystemType() const { return projectileParticleSystemType;}
|
ParticleSystemTypeProjectile* getProjectileParticleSystemType() const { return projectileParticleSystemType;}
|
||||||
float getAttackStartTime() const {return attackStartTime;}
|
float getAttackStartTime() const {return attackStartTime;}
|
||||||
void setAttackStartTime(float value) {attackStartTime=value;}
|
void setAttackStartTime(float value) {attackStartTime=value;}
|
||||||
bool isSplash() const { return splash;}
|
|
||||||
bool isSplashDamageAll() const { return splashDamageAll;}
|
|
||||||
ParticleSystemTypeSplash* getSplashParticleSystemType() const { return splashParticleSystemType;}
|
|
||||||
int getSplashRadius() const { return splashRadius;}
|
|
||||||
|
|
||||||
bool isShake() const{return shake;}
|
bool isShake() const{return shake;}
|
||||||
bool isShakeCameraDistanceAffected() const{return shakeCameraDistanceAffected;}
|
bool isShakeCameraDistanceAffected() const{return shakeCameraDistanceAffected;}
|
||||||
|
|
|
@ -2639,8 +2639,8 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit, float lastAnimProgress,
|
||||||
}
|
}
|
||||||
renderer.manageParticleSystem(psProj, rsGame);
|
renderer.manageParticleSystem(psProj, rsGame);
|
||||||
unit->addAttackParticleSystem(psProj);
|
unit->addAttackParticleSystem(psProj);
|
||||||
ParticleSystemTypeSplash *splashType=(*pt)->getSplashParticleSystemType();
|
|
||||||
if(splashType!=NULL){
|
if(pstSplash!=NULL){
|
||||||
SplashParticleSystem *psSplash= pstSplash->create(unit);
|
SplashParticleSystem *psSplash= pstSplash->create(unit);
|
||||||
psSplash->setPos(endPos);
|
psSplash->setPos(endPos);
|
||||||
psSplash->setVisible(visible);
|
psSplash->setVisible(visible);
|
||||||
|
|
Loading…
Reference in New Issue