Committing incomplete work; need to fix an urgent bug

This commit is contained in:
Kayne Ruse
2015-01-02 06:57:20 +11:00
parent 4579f9f388
commit b2452fb6fe
4 changed files with 36 additions and 7 deletions
+5 -4
View File
@@ -58,9 +58,10 @@ void RoomManager::PushEntity(Entity* entity) {
throw(std::runtime_error(msg.str()));
}
it->second.entityList.push_back(&(*entity));
it->second.entityList.push_back(entity);
std::cout << "\troom[" << it->first << "].entityList.size(): " << it->second.entityList.size() << std::endl;
std::cout << "\tEntity: " << int(entity) << "," << int(it->second.entityList.front()) << std::endl;
}
void RoomManager::PopEntity(Entity* entity) {
@@ -76,9 +77,9 @@ void RoomManager::PopEntity(Entity* entity) {
throw(std::runtime_error(msg.str()));
}
it->second.entityList.remove_if([&](Entity* ptr) -> bool {
bool b = &(*ptr) == &(*entity);
std::cout << "\tmatch(" << int(&(*ptr)) << "," << int(&(*entity)) << "): " << b << std::endl;
it->second.entityList.remove_if([entity](Entity* ptr) -> bool {
bool b = (entity == ptr);
std::cout << "\tmatch(" << int(ptr) << "," << int(entity) << "): " << b << std::endl;
return b;
});