Compare commits

..

No commits in common. "e406c1d5f570d7ab1a9a7587da56cc7866aed8aa" and "6f48f790d49db740068e481e6ec53ee3687e80ab" have entirely different histories.

2 changed files with 7 additions and 13 deletions

View File

@ -73,7 +73,7 @@ static void *ll_load (lua_State *L, const char *path) {
static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {
lua_CFunction f = __extension__(lua_CFunction)dlsym(lib, sym);
lua_CFunction f = (lua_CFunction)dlsym(lib, sym);
if (f == NULL) lua_pushstring(L, dlerror());
return f;
}

View File

@ -935,19 +935,13 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
setInventoryModified(ma->from_inv, false);
setInventoryModified(ma->to_inv, false);
bool from_inv_is_current_player = false;
if (ma->from_inv.type == InventoryLocation::PLAYER) {
if (ma->from_inv.name != player->getName())
return;
from_inv_is_current_player = true;
}
bool from_inv_is_current_player =
(ma->from_inv.type == InventoryLocation::PLAYER) &&
(ma->from_inv.name == player->getName());
bool to_inv_is_current_player = false;
if (ma->to_inv.type == InventoryLocation::PLAYER) {
if (ma->to_inv.name != player->getName())
return;
to_inv_is_current_player = true;
}
bool to_inv_is_current_player =
(ma->to_inv.type == InventoryLocation::PLAYER) &&
(ma->to_inv.name == player->getName());
InventoryLocation *remote = from_inv_is_current_player ?
&ma->to_inv : &ma->from_inv;