diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2015-12-03 07:46:23 -0500 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2015-12-03 07:46:23 -0500 |
commit | bf91141782766f3648b62c6d96528fddb9ae7447 (patch) | |
tree | c6c9322ec7c4f111f05c7f639ab1d33bed9de40f /src/entities.cpp | |
parent | dc24164926a7988e018d32fff1977d2b40c89057 (diff) | |
parent | 6b44ecd9da08087f4a44dd3daef211e763eb1c61 (diff) |
Added holding vs press key action
Diffstat (limited to 'src/entities.cpp')
-rw-r--r-- | src/entities.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index ee5a542..7f78637 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -120,10 +120,12 @@ Structures::Structures(){ //sets the structure type tex = new Texturec(1,"assets/house1.png"); inWorld = NULL; + name = NULL; } Structures::~Structures(){ delete tex; - delete[] name; + if(name) + delete[] name; } Mob::Mob(int sub){ @@ -175,7 +177,6 @@ Object::Object(ITEM_ID id, bool qo, const char *pd){ } Object::~Object(){ delete[] pickupDialog; - delete tex; delete[] name; } @@ -278,10 +279,6 @@ void Player::interact(){ //the function that will cause the player to search for * NPC::wander, this makes the npcs wander around the near area * * timeRun This variable is the amount of gameloop ticks the entity will wander for - * - * *v This is a pointer to whatever vec2 value is passed to it, usually the value - * passed is the entities vec2 for coordinates. Since the value is a pointer - * the memory address passed to it is directly modified. */ void NPC::wander(int timeRun){ @@ -337,7 +334,6 @@ void NPC::interact(){ //have the npc's interact back to the player } } - void Object::interact(void){ if(questObject && alive){ ui::dialogBox("You",":Yes:No",pickupDialog); @@ -434,7 +430,7 @@ void Mob::wander(int timeRun){ player->loc.x + player->width / 2 < loc.x + width ){ if(player->left)player->loc.x = loc.x + width; else if(player->right) player->loc.x = loc.x - player->width; - hey(); + hey(this); } break; default: |