Minor comment tweaks
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
//Define the queries
|
//Define the queries
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
|
//TODO: (1) ensure this is independant of column order
|
||||||
static const char* CREATE_USER_ACCOUNT = "INSERT INTO Accounts (username) VALUES (?);";
|
static const char* CREATE_USER_ACCOUNT = "INSERT INTO Accounts (username) VALUES (?);";
|
||||||
static const char* LOAD_USER_ACCOUNT = "SELECT * FROM Accounts WHERE username = ?;";
|
static const char* LOAD_USER_ACCOUNT = "SELECT * FROM Accounts WHERE username = ?;";
|
||||||
static const char* SAVE_USER_ACCOUNT = "UPDATE OR FAIL Accounts SET blacklisted = ?2, whitelisted = ?3, mod = ?4, admin = ?5 WHERE uid = ?1;";
|
static const char* SAVE_USER_ACCOUNT = "UPDATE OR FAIL Accounts SET blacklisted = ?2, whitelisted = ?3, mod = ?4, admin = ?5 WHERE uid = ?1;";
|
||||||
|
|||||||
@@ -47,17 +47,16 @@ void RoomData::RunFrame() {
|
|||||||
it.second.Update();
|
it.second.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
//compare the triggers to the entities
|
//compare the triggers to the entities, using their real hitboxes
|
||||||
for (auto& it : *triggerMgr.GetContainer()) {
|
for (auto& it : *triggerMgr.GetContainer()) {
|
||||||
|
BoundingBox itBox = it.second.GetBoundingBox() + it.second.GetOrigin();
|
||||||
for (auto& character : characterList) {
|
for (auto& character : characterList) {
|
||||||
//positional boxes
|
|
||||||
BoundingBox hitBox = character->GetBounds() + character->GetOrigin();
|
BoundingBox hitBox = character->GetBounds() + character->GetOrigin();
|
||||||
BoundingBox itBox = it.second.GetBoundingBox() + it.second.GetOrigin();
|
|
||||||
|
|
||||||
if ( itBox.CheckOverlap(hitBox) ) {
|
if ( itBox.CheckOverlap(hitBox) ) {
|
||||||
//TODO: trigger script
|
//trigger script
|
||||||
lua_rawgeti(lua, LUA_REGISTRYINDEX, it.second.GetScriptReference());
|
lua_rawgeti(lua, LUA_REGISTRYINDEX, it.second.GetScriptReference());
|
||||||
lua_pushlightuserdata(lua, character);
|
lua_pushlightuserdata(lua, character); //TODO: (1) entity type
|
||||||
|
|
||||||
//run the script
|
//run the script
|
||||||
if (lua_pcall(lua, 1, 0, 0) != LUA_OK) {
|
if (lua_pcall(lua, 1, 0, 0) != LUA_OK) {
|
||||||
|
|||||||
@@ -23,8 +23,6 @@
|
|||||||
|
|
||||||
#include "trigger_manager.hpp"
|
#include "trigger_manager.hpp"
|
||||||
|
|
||||||
//TODO: (1) figure out a way to iterate through elements of managers from lua
|
|
||||||
|
|
||||||
static int create(lua_State* L) {
|
static int create(lua_State* L) {
|
||||||
//DOCS: params: create(triggerMgr, name[, originX, originY[, boundsX, boundsY, boundsW, boundsH]][, script])
|
//DOCS: params: create(triggerMgr, name[, originX, originY[, boundsX, boundsY, boundsW, boundsH]][, script])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user