|
From: <ka...@us...> - 2012-12-31 02:59:56
|
Revision: 7711
http://paintown.svn.sourceforge.net/paintown/?rev=7711&view=rev
Author: kazzmir
Date: 2012-12-31 02:59:45 +0000 (Mon, 31 Dec 2012)
Log Message:
-----------
[mugen] use ids for projectiles and helpers
Modified Paths:
--------------
trunk/src/mugen/character.cpp
trunk/src/mugen/character.h
trunk/src/mugen/compiler.cpp
trunk/src/mugen/helper.cpp
trunk/src/mugen/helper.h
trunk/src/mugen/object.h
trunk/src/mugen/projectile.cpp
trunk/src/mugen/projectile.h
trunk/src/mugen/stage.cpp
trunk/src/mugen/stage.h
trunk/src/mugen/state-controller.cpp
Modified: trunk/src/mugen/character.cpp
===================================================================
--- trunk/src/mugen/character.cpp 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/character.cpp 2012-12-31 02:59:45 UTC (rev 7711)
@@ -589,6 +589,7 @@
Character::Character(const Character & copy):
Object(copy),
+localData(copy.localData),
stateData(copy.stateData){
}
@@ -2204,8 +2205,8 @@
return getLocalData().bind.time > 0;
}
-void Character::bindTo(const Character * bound, int time, int facing, double offsetX, double offsetY){
- getLocalData().bind.bound = bound->getId();
+void Character::bindTo(const CharacterId & bound, int time, int facing, double offsetX, double offsetY){
+ getLocalData().bind.bound = bound;
getLocalData().bind.time = time;
getLocalData().bind.facing = facing;
getLocalData().bind.offsetX = offsetX;
@@ -2589,8 +2590,8 @@
}
/* players are their own root normally, only helpers differ */
-const Character * Character::getRoot() const {
- return this;
+CharacterId Character::getRoot() const {
+ return getId();
}
const PaintownUtil::ReferenceCount<Mugen::Sprite> Character::getCurrentFrame() const {
@@ -4329,8 +4330,8 @@
return getMoveType() == Move::Attack;
}
-void Character::useCharacterData(const Character * who){
- getLocalData().characterData.who = who->getId();
+void Character::useCharacterData(const CharacterId & who){
+ getLocalData().characterData.who = who;
getLocalData().characterData.enabled = true;
}
Modified: trunk/src/mugen/character.h
===================================================================
--- trunk/src/mugen/character.h 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/character.h 2012-12-31 02:59:45 UTC (rev 7711)
@@ -381,6 +381,10 @@
return getLocalData().animations;
}
+ virtual const std::map<int, PaintownUtil::ReferenceCount<State> > & getStates() const {
+ return getLocalData().states;
+ }
+
virtual PaintownUtil::ReferenceCount<Animation> getAnimation(int id) const;
/*
@@ -810,12 +814,12 @@
void enableHit();
void disableHit();
- virtual const Character * getRoot() const;
+ virtual CharacterId getRoot() const;
/* binds this character to 'bound' meaning this character's position
* will be the same as 'bound' and adjusted by the facing and offsets
*/
- virtual void bindTo(const Character * bound, int time, int facing, double offsetX, double offsetY);
+ virtual void bindTo(const CharacterId & bound, int time, int facing, double offsetX, double offsetY);
std::map<int, std::vector<CharacterId> > & getTargets();
const std::map<int, std::vector<CharacterId> > & getTargets() const;
@@ -1181,7 +1185,7 @@
virtual StateController * parseState(Ast::Section * section);
virtual PaintownUtil::ReferenceCount<State> parseStateDefinition(Ast::Section * section, const Filesystem::AbsolutePath & path, std::map<int, PaintownUtil::ReferenceCount<State> > & states);
- virtual void useCharacterData(const Character * who);
+ virtual void useCharacterData(const CharacterId & who);
// InputMap<Mugen::Keys> & getInput();
Modified: trunk/src/mugen/compiler.cpp
===================================================================
--- trunk/src/mugen/compiler.cpp 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/compiler.cpp 2012-12-31 02:59:45 UTC (rev 7711)
@@ -2041,7 +2041,7 @@
const Character & guy = environment.getCharacter();
if (guy.isHelper()){
const Mugen::Helper & myhelper = *(const Mugen::Helper*)&guy;
- Character * parent = myhelper.getParent();
+ Character * parent = environment.getStage().getCharacter(myhelper.getParent());
if (parent == NULL){
runtimeError("Helper has no parent", __FILE__, __LINE__);
}
@@ -2075,7 +2075,7 @@
RuntimeValue evaluate(const Environment & environment) const {
const Character & guy = environment.getCharacter();
- const Character * parent = guy.getRoot();
+ const Character * parent = environment.getStage().getCharacter(guy.getRoot());
if (parent == NULL){
runtimeError("object has no parent", __FILE__, __LINE__);
}
@@ -4696,7 +4696,7 @@
const Character & helper = environment.getCharacter();
if (helper.isHelper()){
const Helper & realHelper = *(const Helper*) &helper;
- const Character * parent = realHelper.getParent();
+ const Character * parent = environment.getStage().getCharacter(realHelper.getParent());
if (parent == NULL){
runtimeError("Helper has no parent", __FILE__, __LINE__);
}
@@ -4721,7 +4721,7 @@
const Character & helper = environment.getCharacter();
if (helper.isHelper()){
const Helper & realHelper = *(const Helper*) &helper;
- const Character * parent = realHelper.getParent();
+ const Character * parent = environment.getStage().getCharacter(realHelper.getParent());
if (parent == NULL){
runtimeError("Helper has no parent", __FILE__, __LINE__);
}
@@ -4787,7 +4787,7 @@
class RootDistX: public Value {
public:
RuntimeValue evaluate(const Environment & environment) const {
- const Character * root = environment.getCharacter().getRoot();
+ const Character * root = environment.getStage().getCharacter(environment.getCharacter().getRoot());
if (root == NULL){
runtimeError("No root", __FILE__, __LINE__);
}
@@ -4806,7 +4806,7 @@
class RootDistY: public Value {
public:
RuntimeValue evaluate(const Environment & environment) const {
- const Character * root = environment.getCharacter().getRoot();
+ const Character * root = environment.getStage().getCharacter(environment.getCharacter().getRoot());
if (root == NULL){
runtimeError("No root", __FILE__, __LINE__);
}
Modified: trunk/src/mugen/helper.cpp
===================================================================
--- trunk/src/mugen/helper.cpp 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/helper.cpp 2012-12-31 02:59:45 UTC (rev 7711)
@@ -9,11 +9,15 @@
Helper::Helper(Character * owner, const Character * root, int id, const string & name):
Character(*owner),
-owner(owner),
-root(root),
+owner(owner->getId()),
+root(root->getId()),
id(id),
name(owner->getName() + " " + name + " (helper)"){
getLocalData().behavior = &dummy;
+ getLocalData().states = owner->getStates();
+ getLocalData().animations = owner->getAnimations();
+ getLocalData().sounds = owner->getSounds();
+ getLocalData().commonSounds = owner->getCommonSounds();
}
Helper::~Helper(){
@@ -24,7 +28,7 @@
stage.removeHelper(this);
}
-void Helper::reParent(Character * parent){
+void Helper::reParent(const CharacterId & parent){
this->owner = parent;
}
@@ -52,8 +56,8 @@
return RefState(NULL);
}
map<int, RefState>::const_iterator findIt = proxyStates.find(id);
- if (findIt == proxyStates.end() && owner != NULL){
- RefState dad = owner->getSelfState(id);
+ if (findIt == proxyStates.end()){
+ RefState dad = Character::getState(id, stage);
if (dad != NULL){
/* this is why proxyStates has to be mutable */
proxyStates[id] = RefState(dad->deepCopy());
@@ -73,21 +77,7 @@
const std::string Helper::getDisplayName() const {
return name;
}
-
-PaintownUtil::ReferenceCount<Mugen::Sound> Helper::getSound(int group, int item) const {
- if (owner != NULL){
- return owner->getSound(group, item);
- }
- return PaintownUtil::ReferenceCount<Mugen::Sound>(NULL);
-}
-PaintownUtil::ReferenceCount<Mugen::Sound> Helper::getCommonSound(int group, int item) const {
- if (owner != NULL){
- return owner->getCommonSound(group, item);
- }
- return PaintownUtil::ReferenceCount<Mugen::Sound>(NULL);
-}
-
/*
bool Helper::doStates(MugenStage & stage, const std::vector<string> & active, int stateNumber){
if (getState(stateNumber) == NULL){
@@ -102,17 +92,18 @@
PaintownUtil::ReferenceCount<Animation> Helper::getAnimation(int id) const {
map<int, PaintownUtil::ReferenceCount<Animation> >::const_iterator findIt = proxyAnimations.find(id);
- if (findIt == proxyAnimations.end() && owner != NULL){
- if (owner->hasAnimation(id)){
- PaintownUtil::ReferenceCount<Animation> dad = owner->getAnimation(id);
- /* this is why proxyAnimations has to be mutable */
- proxyAnimations[id] = PaintownUtil::ReferenceCount<Animation>(new Animation(*dad));
+ if (findIt == proxyAnimations.end()){
+ PaintownUtil::ReferenceCount<Animation> originalAnimation = Character::getAnimation(id);
+ if (originalAnimation != NULL){
+ /* We have to copy the animation because the animation stores state about
+ * which frame is being shown and we don't want to mess up the
+ * original characters animations.
+ * this is why proxyAnimations has to be mutable */
+ proxyAnimations[id] = PaintownUtil::ReferenceCount<Animation>(new Animation(*originalAnimation));
return proxyAnimations[id];
}
} else {
- if (findIt != proxyAnimations.end()){
- return findIt->second;
- }
+ return findIt->second;
}
return PaintownUtil::ReferenceCount<Animation>(NULL);
}
Modified: trunk/src/mugen/helper.h
===================================================================
--- trunk/src/mugen/helper.h 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/helper.h 2012-12-31 02:59:45 UTC (rev 7711)
@@ -29,32 +29,32 @@
using Character::getState;
virtual PaintownUtil::ReferenceCount<State> getState(int id, Stage & stage) const;
- void reParent(Character * parent);
+ void reParent(const CharacterId & parent);
- inline Character * getParent() const {
+ inline CharacterId getParent() const {
return owner;
}
virtual void roundEnd(Mugen::Stage & stage);
- virtual const Character * getRoot() const {
+ using Character::getRoot;
+ virtual CharacterId getRoot() const {
return root;
}
-
- virtual PaintownUtil::ReferenceCount<Mugen::Sound> getSound(int group, int item) const;
- virtual PaintownUtil::ReferenceCount<Mugen::Sound> getCommonSound(int group, int item) const;
protected:
/* the character that spawned this helper */
- Character * owner;
+ CharacterId owner;
/* the root character. player -> helper A -> helper B
* the root of B is the player
*/
- const Character * root;
+ const CharacterId root;
HitDefinition hit;
DummyBehavior dummy;
mutable std::map< int, PaintownUtil::ReferenceCount<Animation> > proxyAnimations;
mutable std::map< int, PaintownUtil::ReferenceCount<State> > proxyStates;
+
+ /* Id of the helper according to mugen script */
int id;
std::string name;
};
Modified: trunk/src/mugen/object.h
===================================================================
--- trunk/src/mugen/object.h 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/object.h 2012-12-31 02:59:45 UTC (rev 7711)
@@ -57,9 +57,9 @@
virtual double getHealth() const = 0;
- virtual void drawReflection(Graphics::Bitmap * work, int rel_x, int rel_y, int intensity) = 0;
+ // virtual void drawReflection(Graphics::Bitmap * work, int rel_x, int rel_y, int intensity) = 0;
virtual void drawMugenShade(Graphics::Bitmap * work, int rel_x, int intensity, Graphics::Color color, double scale, int fademid, int fadehigh) = 0;
- virtual void draw(Graphics::Bitmap * work, int rel_x, int rel_y) = 0;
+ // virtual void draw(Graphics::Bitmap * work, int rel_x, int rel_y) = 0;
// virtual void act(std::vector<Mugen::Object*>*, Stage*, std::vector<Mugen::Object*>*) = 0;
@@ -106,8 +106,8 @@
virtual const HitDefinition & getHit() const = 0;
virtual int getCurrentJuggle() const = 0;
virtual bool isAttacking() const = 0;
- virtual const std::vector<Area> getAttackBoxes() const = 0;
- virtual const std::vector<Area> getDefenseBoxes() const = 0;
+ // virtual const std::vector<Area> getAttackBoxes() const = 0;
+ // virtual const std::vector<Area> getDefenseBoxes() const = 0;
virtual ResourceEffect getDefaultSpark() const = 0;
virtual ResourceEffect getDefaultGuardSpark() const = 0;
virtual int getAttackDistance() const = 0;
Modified: trunk/src/mugen/projectile.cpp
===================================================================
--- trunk/src/mugen/projectile.cpp 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/projectile.cpp 2012-12-31 02:59:45 UTC (rev 7711)
@@ -18,7 +18,7 @@
int edge, int stageDistance, int lowBound, int highBound, int shadowRed,
int shadowGreen, int shadowBlue, int superMoveTime, int pauseMoveTime,
int afterImageTime, int afterImageLength, Facing facing, const HitDefinition & hit):
-owner(owner),
+owner(owner->getId()),
spritePriority(spritePriority),
x(x),
y(y),
@@ -56,7 +56,7 @@
Projectile::~Projectile(){
}
-Character * Projectile::getOwner() const {
+const CharacterId & Projectile::getOwner() const {
return owner;
}
@@ -100,7 +100,7 @@
void Projectile::doCollision(Object * mugen, const Stage & stage){
hits -= 1;
if (hits <= 0){
- PaintownUtil::ReferenceCount<Animation> his = owner->getAnimation(hitAnimation);
+ PaintownUtil::ReferenceCount<Animation> his = stage.getCharacter(owner)->getAnimation(hitAnimation);
if (his != NULL){
this->animation = PaintownUtil::ReferenceCount<Animation>(his->copy());
}
@@ -144,13 +144,13 @@
velocityX = removeVelocityX;
velocityY = removeVelocityY;
lastCanceled = stage.getTicks();
- PaintownUtil::ReferenceCount<Animation> his = owner->getAnimation(cancelAnimation);
+ PaintownUtil::ReferenceCount<Animation> his = stage.getCharacter(owner)->getAnimation(cancelAnimation);
if (his != NULL){
this->animation = PaintownUtil::ReferenceCount<Animation>(his->copy());
}
}
-void Projectile::logic(){
+void Projectile::logic(Stage & stage){
if (animation != NULL){
animation->logic();
}
@@ -165,7 +165,7 @@
removeTime -= 1;
if (removeTime == 0){
- PaintownUtil::ReferenceCount<Animation> his = owner->getAnimation(removeAnimation);
+ PaintownUtil::ReferenceCount<Animation> his = stage.getCharacter(owner)->getAnimation(removeAnimation);
if (his != NULL){
this->animation = PaintownUtil::ReferenceCount<Animation>(his->copy());
}
Modified: trunk/src/mugen/projectile.h
===================================================================
--- trunk/src/mugen/projectile.h 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/projectile.h 2012-12-31 02:59:45 UTC (rev 7711)
@@ -18,7 +18,7 @@
class Character;
class Projectile{
public:
- Projectile(double x, double y, int id, Character * owner, int animation, int hitAnimation, int dieAnimation,
+ Projectile(double x, double y, int id,Character * owner, int animation, int hitAnimation, int dieAnimation,
int cancelAnimation, double scaleX, double scaleY, bool autoRemove, int removeTime,
double velocityX, double velocityY, double removeVelocityX, double removeVelocityY,
double accelerateX, double accelerateY, double velocityXMultipler,
@@ -31,7 +31,7 @@
virtual int getSpritePriority() const;
virtual void draw(const Graphics::Bitmap & work, double x, double y);
- virtual void logic();
+ virtual void logic(Stage & stage);
/* Projectile priority. If this projectile has higher priority than another projectile
* then if the projectiles collide, the other projectile will cancel.
@@ -61,7 +61,7 @@
/* False if the miss time is still active */
bool canCollide() const;
- virtual Character * getOwner() const;
+ virtual const CharacterId & getOwner() const;
const std::vector<Area> getAttackBoxes() const;
const std::vector<Area> getDefenseBoxes() const;
@@ -76,7 +76,7 @@
}
protected:
- Character * owner;
+ CharacterId owner;
int spritePriority;
::Util::ReferenceCount<Animation> animation;
double x, y;
Modified: trunk/src/mugen/stage.cpp
===================================================================
--- trunk/src/mugen/stage.cpp 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/stage.cpp 2012-12-31 02:59:45 UTC (rev 7711)
@@ -759,16 +759,16 @@
return false;
}
-bool Mugen::Stage::doBlockingDetection(Mugen::Object * obj1, Mugen::Object * obj2){
+bool Mugen::Stage::doBlockingDetection(Mugen::Character * obj1, Mugen::Character * obj2){
// return anyBlocking(obj1->getAttackBoxes(), (int) obj1->getX(), (int) obj1->getY(), obj1->getAttackDistance(), obj2->getDefenseBoxes(), (int) obj2->getX(), (int) obj2->getY());
return anyBlocking(obj1->getAttackBoxes(), (int) obj1->getX(), (int) obj1->getY(), 0, obj2->getDefenseBoxes(), (int) obj2->getX(), (int) obj2->getY());
}
-bool Mugen::Stage::doCollisionDetection(Mugen::Object * obj1, Mugen::Object * obj2){
+bool Mugen::Stage::doCollisionDetection(Mugen::Character * obj1, Mugen::Character * obj2){
return anyCollisions(obj1->getAttackBoxes(), (int) obj1->getX(), (int) obj1->getY(), obj2->getDefenseBoxes(), (int) obj2->getX(), (int) obj2->getY());
}
-bool Mugen::Stage::doReversalDetection(Mugen::Object * obj1, Mugen::Object * obj2){
+bool Mugen::Stage::doReversalDetection(Mugen::Character * obj1, Mugen::Character * obj2){
return anyCollisions(obj1->getAttackBoxes(), (int) obj1->getX(), (int) obj1->getY(), obj2->getAttackBoxes(), (int) obj2->getX(), (int) obj2->getY());
}
@@ -842,7 +842,7 @@
projectile->getAttackBoxes(), (int) projectile->getX(), (int) projectile->getY())){
projectile->doCollision(mugen, *this);
- Character * owner = projectile->getOwner();
+ Character * owner = getCharacter(projectile->getOwner());
bool block = mugen->isBlocking(projectile->getHitDefinition());
@@ -852,7 +852,7 @@
(int)(projectile->getHitDefinition().sparkPosition.y + projectile->getY()),
projectile->getHitDefinition().guardSpark,
owner->getDefaultGuardSpark(),
- projectile->getOwner());
+ getCharacter(projectile->getOwner()));
playSound(owner, projectile->getHitDefinition().guardHitSound.group, projectile->getHitDefinition().guardHitSound.item, projectile->getHitDefinition().guardHitSound.own);
mugen->guarded(*this, owner, projectile->getHitDefinition());
@@ -863,7 +863,7 @@
(int)(projectile->getHitDefinition().sparkPosition.y + projectile->getY()),
projectile->getHitDefinition().spark,
owner->getDefaultSpark(),
- projectile->getOwner());
+ getCharacter(projectile->getOwner()));
playSound(owner, projectile->getHitDefinition().hitSound.group, projectile->getHitDefinition().hitSound.item, projectile->getHitDefinition().hitSound.own);
mugen->wasHit(*this, owner, projectile->getHitDefinition());
@@ -1006,7 +1006,7 @@
for (vector<Projectile*>::iterator it = projectiles.begin(); it != projectiles.end(); it++){
Projectile * projectile = *it;
- if (projectile->getOwner() != mugen && projectile->canCollide()){
+ if (projectile->getOwner() != mugen->getId() && projectile->canCollide()){
doProjectileCollision(projectile, mugen);
}
@@ -1253,7 +1253,7 @@
/* FIXME: Projectiles should not act during a pause or superpause */
for (vector<Projectile*>::iterator it = projectiles.begin(); it != projectiles.end(); /**/){
Projectile * projectile = *it;
- projectile->logic();
+ projectile->logic(*this);
if (projectile->isDead()){
delete projectile;
@@ -2469,7 +2469,7 @@
Mugen::Character * who = *it;
if (who->isHelper()){
Mugen::Helper * helper = (Mugen::Helper*) who;
- if (helper->getParent() == owner){
+ if (helper->getParent() == owner->getId()){
count += 1;
}
}
@@ -2520,7 +2520,7 @@
for (vector<Mugen::Helper*>::iterator it = children.begin(); it != children.end(); it++){
Mugen::Helper * helper = *it;
/* lose parent association, still has root though */
- helper->reParent(NULL);
+ helper->reParent(CharacterId(-1));
}
}
@@ -2566,7 +2566,7 @@
for (vector<Projectile*>::const_iterator it = projectiles.begin(); it != projectiles.end(); it++){
Projectile * projectile = *it;
- if ((id == 0 || projectile->getId() == id) && projectile->getOwner() == owner){
+ if ((id == 0 || projectile->getId() == id) && projectile->getOwner() == owner->getId()){
found.push_back(projectile);
}
}
@@ -2580,7 +2580,7 @@
Mugen::Character * who = *it;
if (who->isHelper()){
Mugen::Helper * helper = (Mugen::Helper*) who;
- if (helper->getHelperId() == id && helper->getParent() == owner){
+ if (helper->getHelperId() == id && helper->getParent() == owner->getId()){
out.push_back(helper);
}
}
@@ -2593,7 +2593,7 @@
Mugen::Character * who = *it;
if (who->isHelper()){
Mugen::Helper * helper = (Mugen::Helper*) who;
- if (helper->getHelperId() == id && helper->getParent() == owner){
+ if (helper->getHelperId() == id && helper->getParent() == owner->getId()){
out.push_back(helper);
}
}
@@ -2607,7 +2607,7 @@
Mugen::Character * who = *it;
if (who->isHelper()){
Mugen::Helper * helper = (Mugen::Helper*) who;
- if (helper->getParent() == owner){
+ if (helper->getParent() == owner->getId()){
out.push_back(helper);
}
}
@@ -2617,7 +2617,7 @@
Mugen::Character * who = *it;
if (who->isHelper()){
Mugen::Helper * helper = (Mugen::Helper*) who;
- if (helper->getParent() == owner){
+ if (helper->getParent() == owner->getId()){
out.push_back(helper);
}
}
Modified: trunk/src/mugen/stage.h
===================================================================
--- trunk/src/mugen/stage.h 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/stage.h 2012-12-31 02:59:45 UTC (rev 7711)
@@ -371,9 +371,9 @@
void updatePlayer(Character *o);
void physics(Character * o);
- bool doBlockingDetection(Object * obj1, Object * obj2);
- bool doCollisionDetection(Object * obj1, Object * obj2);
- bool doReversalDetection(Object * obj1, Object * obj2);
+ bool doBlockingDetection(Character * obj1, Character * obj2);
+ bool doCollisionDetection(Character * obj1, Character * obj2);
+ bool doReversalDetection(Character * obj1, Character * obj2);
CharacterId nextId();
Modified: trunk/src/mugen/state-controller.cpp
===================================================================
--- trunk/src/mugen/state-controller.cpp 2012-12-31 01:10:32 UTC (rev 7710)
+++ trunk/src/mugen/state-controller.cpp 2012-12-31 02:59:45 UTC (rev 7711)
@@ -5225,7 +5225,7 @@
double y = (double) evaluateNumber(this->posY, environment, 0);
for (vector<Character*>::iterator it = targets.begin(); it != targets.end(); it++){
Character * target = *it;
- target->bindTo(&guy, time, 0, x, y);
+ target->bindTo(guy.getId(), time, 0, x, y);
}
}
@@ -6632,7 +6632,7 @@
virtual void activate(Mugen::Stage & stage, Character & guy, const vector<string> & commands) const {
FullEnvironment environment(stage, guy, commands);
/* FIXME */
- Mugen::Helper * helper = new Mugen::Helper(&guy, guy.getRoot(), (int) evaluateNumber(id, environment, 0), name);
+ Mugen::Helper * helper = new Mugen::Helper(&guy, environment.getStage().getCharacter(guy.getRoot()), (int) evaluateNumber(id, environment, 0), name);
helper->setOwnPalette(evaluateBool(ownPalette, environment, false));
@@ -6887,7 +6887,7 @@
virtual void activate(Mugen::Stage & stage, Character & guy, const vector<string> & commands) const {
if (guy.isHelper()){
Mugen::Helper & helper = *(Mugen::Helper*)&guy;
- Character * parent = helper.getParent();
+ Character * parent = stage.getCharacter(helper.getParent());
if (parent == NULL){
throw MugenNormalRuntimeException("No parent for helper");
}
@@ -6962,7 +6962,7 @@
virtual void activate(Mugen::Stage & stage, Character & guy, const vector<string> & commands) const {
if (guy.isHelper()){
Mugen::Helper & helper = *(Mugen::Helper*)&guy;
- Character * parent = helper.getParent();
+ Character * parent = stage.getCharacter(helper.getParent());
if (parent == NULL){
throw MugenNormalRuntimeException("No parent for helper");
}
@@ -7762,7 +7762,7 @@
}
/* FIXME: we have to cast the root to a non-const Character* */
- stage.addProjectile(new Mugen::Projectile(x, y, id, (Character*) guy.getRoot(), animation, hitAnimation, dieAnimation,
+ stage.addProjectile(new Mugen::Projectile(x, y, id, (Character*) stage.getCharacter(guy.getRoot()), animation, hitAnimation, dieAnimation,
cancelAnimation, scaleX, scaleY, autoRemove, removeTime,
velocityX, velocityY, removeVelocityX, removeVelocityY,
accelerateX, accelerateY, velocityXMultipler,
@@ -8129,7 +8129,7 @@
pointX = position.x;
pointY = position.y;
}
- guy.bindTo(target, time, 0, pointX + x, pointY + y);
+ guy.bindTo(target->getId(), time, 0, pointX + x, pointY + y);
}
}
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|