Erwan
- fixed a bug with Flagstones of Trokair. There was no easy fix (cloned objects deleting stuff from their parents...) and I ended up using a "garbage collect at end of turn" technique the way I did with the ActionStack. As a result, the memory print of a turn will become bigger, and even more bugs might occur at the end of a turn... I'm ready to discuss this, although I think it's the best solution (in terms of result/amount of work) given the way abilities work right now - Test suite now gives the number of failed/success at the end of the tests
This commit is contained in:
@@ -18,6 +18,7 @@ class WEvent;
|
||||
|
||||
class ActionLayer: public GuiLayer, public JGuiListener{
|
||||
public:
|
||||
vector <ActionElement *> garbage;
|
||||
Targetable * menuObject;
|
||||
SimpleMenu * abilitiesMenu;
|
||||
int stuffHappened;
|
||||
@@ -42,6 +43,8 @@ class ActionLayer: public GuiLayer, public JGuiListener{
|
||||
void doReactTo(int menuIndex);
|
||||
TargetChooser * getCurrentTargetChooser();
|
||||
MTGAbility * getAbility(int type);
|
||||
int moveToGarbage(ActionElement * e);
|
||||
int cleanGarbage();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -215,9 +215,9 @@ public:
|
||||
}
|
||||
|
||||
~MultiAbility(){
|
||||
if (!isClone){
|
||||
if (!isClone){
|
||||
vector<int>::size_type sz = abilities.size();
|
||||
for (unsigned int i = 0; i < sz; i++){
|
||||
for (size_t i = 0; i < sz; i++){
|
||||
delete abilities[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ class TestSuite{
|
||||
string files[1024];
|
||||
int nbfiles;
|
||||
int currentfile;
|
||||
int nbFailed, nbTests;
|
||||
int load(const char * filename);
|
||||
TestSuite(const char * filename,MTGAllCards* _collection);
|
||||
void initGame();
|
||||
|
||||
Reference in New Issue
Block a user