From b7e31e8b7ce8f470a269c6bc17e6525c6f3a4d50 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Mon, 25 Apr 2016 08:48:39 -0400 Subject: fixed bugs --- include/common.hpp | 4 ++++ include/inventory.hpp | 12 ++++-------- include/world.hpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/common.hpp b/include/common.hpp index 7f36be2..5a0fcb2 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -103,6 +103,10 @@ struct _vec2 { x = y = n; return *this; } + template + const _vec2 operator+(const T &n) { + return _vec2 {x + n, y + n}; + } }; typedef struct _vec2 vec2; diff --git a/include/inventory.hpp b/include/inventory.hpp index 4fb45f9..ce887c3 100644 --- a/include/inventory.hpp +++ b/include/inventory.hpp @@ -11,19 +11,15 @@ class Item{ public: std::string name, type; + std::string texloc; + + Texturec *tex; float width; float height; int maxStackSize; float attribValue; - std::string texloc; - Texturec *tex; - - GLuint rtex() - { - return tex->image[0]; - } }; class Currency{ @@ -44,7 +40,7 @@ public: } }; -struct item_t{ +struct item_t { uint count; uint id; } __attribute__((packed)); diff --git a/include/world.hpp b/include/world.hpp index c6eaf06..dc8d497 100644 --- a/include/world.hpp +++ b/include/world.hpp @@ -220,7 +220,7 @@ public: bool goWorldLeft(NPC *e); // attempts to enter a structure that the player would be standing in front of - World *goInsideStructure(Player *p); + std::pair goInsideStructure(Player *p); // adds a hole at the specified start and end x-coordinates void addHole(unsigned int start,unsigned int end); -- cgit v1.2.3