From e91f0c208605f27d2ba9e2a9c584c92212ab0088 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Wed, 6 May 2015 14:03:33 -0500 Subject: made list vector not get infinitly big --- src/creature.cpp | 10 ++++------ src/list.cpp | 5 +++++ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/creature.cpp b/src/creature.cpp index 2e5e1ab..9d50291 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -20,13 +20,13 @@ Creature::Creature(Window m, std::string s) void Creature::Behavior() { hp--; - //Detection + //Detection - //Priorities + //Priorities - //Action - this->Action(); + //Action + this->Action(); } void Creature::Action() @@ -76,8 +76,6 @@ void Creature::Action() } } - - /* else { diff --git a/src/list.cpp b/src/list.cpp index b8a809c..c3246c9 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -29,6 +29,11 @@ void List::Behavior() void List::Place() { int i; + + for(i = 0;i < L.size(); i++) + if(L.getType()==1) + L.erase(L.begin()+i); + for(i = 0; i < C.size(); i++) { C[i].Place(); -- cgit v1.2.3