1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives

This commit is contained in:
Craig Robbins 2015-03-06 20:21:51 +10:00
parent a603a76787
commit ced6d20295
62 changed files with 299 additions and 294 deletions

View file

@ -1306,7 +1306,7 @@ Inventory* Server::getInventory(const InventoryLocation &loc)
}
break;
default:
assert(0);
sanity_check(false); // abort
break;
}
return NULL;
@ -1345,7 +1345,7 @@ void Server::setInventoryModified(const InventoryLocation &loc)
}
break;
default:
assert(0);
sanity_check(false); // abort
break;
}
}
@ -1454,7 +1454,7 @@ void Server::handlePeerChanges()
break;
default:
assert("Invalid peer change event received!" == 0);
FATAL_ERROR("Invalid peer change event received!");
break;
}
}
@ -2637,8 +2637,8 @@ void Server::UpdateCrafting(Player* player)
// Put the new preview in
InventoryList *plist = player->inventory.getList("craftpreview");
assert(plist);
assert(plist->getSize() >= 1);
sanity_check(plist);
sanity_check(plist->getSize() >= 1);
plist->changeItem(0, preview);
}
@ -3026,7 +3026,7 @@ Inventory* Server::createDetachedInventory(const std::string &name)
infostream<<"Server creating detached inventory \""<<name<<"\""<<std::endl;
}
Inventory *inv = new Inventory(m_itemdef);
assert(inv);
sanity_check(inv);
m_detached_inventories[name] = inv;
//TODO find a better way to do this
sendDetachedInventory(name,PEER_ID_INEXISTENT);