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 --- inc/location.hpp | 4 ++-- src/creature.cpp | 10 ++++------ src/list.cpp | 5 +++++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/inc/location.hpp b/inc/location.hpp index c4428f5..2042734 100644 --- a/inc/location.hpp +++ b/inc/location.hpp @@ -7,9 +7,9 @@ class Location Location(){x=y=t=0;}; Location(int x, int y, int z){}; int getType(){return t;}; - + private: - int x; + int x; int y; int t; }; 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