diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-04-23 21:55:31 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-04-23 21:55:31 -0400 |
commit | debb080a17eba2b2957e99ba7f1ce0fa0c4d2e4e (patch) | |
tree | 621bcf54c0f97b202e21bb4f21f5107f852cba63 /src/entities.cpp | |
parent | 6e51f9723635de3defce30517fa1043f26e27ee9 (diff) | |
parent | e04fae7b72b424e5019429a071ad2de9edf4df1f (diff) |
Fixed some bugs
Diffstat (limited to 'src/entities.cpp')
-rw-r--r-- | src/entities.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index c52ff4e..96fe0e6 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -114,7 +114,10 @@ void Entity::spawn(float x, float y) { //spawns the entity you pass to it based } name = new char[32]; - getRandomName(this); + if (type == MOBT) + name[0] = '\0'; + else + getRandomName(this); followee = NULL; } @@ -382,14 +385,7 @@ void Entity::draw(void) { //draws the entities } break; case STRUCTURET: - for(auto &strt : currentWorld->build) { - if (this == strt) { - glActiveTexture(GL_TEXTURE0); - tex->bind(0); - break; - } - } - break; + /* fall through */ default: glActiveTexture(GL_TEXTURE0); tex->bind(0); @@ -414,7 +410,7 @@ NOPE: glDisable(GL_TEXTURE_2D); glMatrixMode(GL_MODELVIEW); glPopMatrix(); - if (near) + if (near && type != MOBT) ui::putStringCentered(loc.x+width/2,loc.y-ui::fontSize-HLINE/2,name); if (health != maxHealth) { glColor3ub(150,0,0); glRectf(loc.x, loc.y + height, loc.x + width, loc.y + height + HLINE * 2); |