Minor comment tweaks

This commit is contained in:
Kayne Ruse
2015-03-06 00:13:12 +11:00
parent 41d6314beb
commit a8c309ec9d
3 changed files with 5 additions and 7 deletions
+4 -5
View File
@@ -47,17 +47,16 @@ void RoomData::RunFrame() {
it.second.Update();
}
//compare the triggers to the entities
//compare the triggers to the entities, using their real hitboxes
for (auto& it : *triggerMgr.GetContainer()) {
BoundingBox itBox = it.second.GetBoundingBox() + it.second.GetOrigin();
for (auto& character : characterList) {
//positional boxes
BoundingBox hitBox = character->GetBounds() + character->GetOrigin();
BoundingBox itBox = it.second.GetBoundingBox() + it.second.GetOrigin();
if ( itBox.CheckOverlap(hitBox) ) {
//TODO: trigger script
//trigger script
lua_rawgeti(lua, LUA_REGISTRYINDEX, it.second.GetScriptReference());
lua_pushlightuserdata(lua, character);
lua_pushlightuserdata(lua, character); //TODO: (1) entity type
//run the script
if (lua_pcall(lua, 1, 0, 0) != LUA_OK) {