mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
'fix' LINT, use InventoryLocation==
This commit is contained in:
parent
9fa547bb80
commit
e98fd934ce
@ -245,8 +245,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
|||||||
*/
|
*/
|
||||||
bool ignore_rollback = (
|
bool ignore_rollback = (
|
||||||
from_inv.type == InventoryLocation::PLAYER &&
|
from_inv.type == InventoryLocation::PLAYER &&
|
||||||
to_inv.type == InventoryLocation::PLAYER &&
|
from_inv == to_inv);
|
||||||
from_inv.name == to_inv.name);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Collect information of endpoints
|
Collect information of endpoints
|
||||||
@ -263,8 +262,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
|||||||
|
|
||||||
// Move occurs in the same detached inventory
|
// Move occurs in the same detached inventory
|
||||||
if (from_inv.type == InventoryLocation::DETACHED &&
|
if (from_inv.type == InventoryLocation::DETACHED &&
|
||||||
to_inv.type == InventoryLocation::DETACHED &&
|
from_inv == to_inv) {
|
||||||
from_inv.name == to_inv.name) {
|
|
||||||
src_can_take_count = PLAYER_TO_SA(player)->detached_inventory_AllowMove(
|
src_can_take_count = PLAYER_TO_SA(player)->detached_inventory_AllowMove(
|
||||||
*this, try_take_count, player);
|
*this, try_take_count, player);
|
||||||
dst_can_put_count = src_can_take_count;
|
dst_can_put_count = src_can_take_count;
|
||||||
@ -290,8 +288,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
|||||||
// Both endpoints are nodemeta
|
// Both endpoints are nodemeta
|
||||||
// Move occurs in the same nodemeta inventory
|
// Move occurs in the same nodemeta inventory
|
||||||
if (from_inv.type == InventoryLocation::NODEMETA &&
|
if (from_inv.type == InventoryLocation::NODEMETA &&
|
||||||
to_inv.type == InventoryLocation::NODEMETA &&
|
from_inv == to_inv) {
|
||||||
from_inv.p == to_inv.p) {
|
|
||||||
src_can_take_count = PLAYER_TO_SA(player)->nodemeta_inventory_AllowMove(
|
src_can_take_count = PLAYER_TO_SA(player)->nodemeta_inventory_AllowMove(
|
||||||
*this, try_take_count, player);
|
*this, try_take_count, player);
|
||||||
dst_can_put_count = src_can_take_count;
|
dst_can_put_count = src_can_take_count;
|
||||||
@ -316,8 +313,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
|||||||
|
|
||||||
// Move occurs in the same player inventory
|
// Move occurs in the same player inventory
|
||||||
if (from_inv.type == InventoryLocation::PLAYER &&
|
if (from_inv.type == InventoryLocation::PLAYER &&
|
||||||
to_inv.type == InventoryLocation::PLAYER &&
|
from_inv == to_inv) {
|
||||||
from_inv.name == to_inv.name) {
|
|
||||||
src_can_take_count = PLAYER_TO_SA(player)->player_inventory_AllowMove(
|
src_can_take_count = PLAYER_TO_SA(player)->player_inventory_AllowMove(
|
||||||
*this, try_take_count, player);
|
*this, try_take_count, player);
|
||||||
dst_can_put_count = src_can_take_count;
|
dst_can_put_count = src_can_take_count;
|
||||||
@ -472,8 +468,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
|||||||
|
|
||||||
// Both endpoints are same detached
|
// Both endpoints are same detached
|
||||||
if (from_inv.type == InventoryLocation::DETACHED &&
|
if (from_inv.type == InventoryLocation::DETACHED &&
|
||||||
to_inv.type == InventoryLocation::DETACHED &&
|
from_inv == to_inv) {
|
||||||
from_inv.name == to_inv.name) {
|
|
||||||
PLAYER_TO_SA(player)->detached_inventory_OnMove(
|
PLAYER_TO_SA(player)->detached_inventory_OnMove(
|
||||||
*this, count, player);
|
*this, count, player);
|
||||||
} else {
|
} else {
|
||||||
@ -493,8 +488,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
|||||||
|
|
||||||
// Both endpoints are same nodemeta
|
// Both endpoints are same nodemeta
|
||||||
if (from_inv.type == InventoryLocation::NODEMETA &&
|
if (from_inv.type == InventoryLocation::NODEMETA &&
|
||||||
to_inv.type == InventoryLocation::NODEMETA &&
|
from_inv == to_inv) {
|
||||||
from_inv.p == to_inv.p) {
|
|
||||||
PLAYER_TO_SA(player)->nodemeta_inventory_OnMove(
|
PLAYER_TO_SA(player)->nodemeta_inventory_OnMove(
|
||||||
*this, count, player);
|
*this, count, player);
|
||||||
} else {
|
} else {
|
||||||
@ -514,8 +508,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
|||||||
|
|
||||||
// Both endpoints are same player inventory
|
// Both endpoints are same player inventory
|
||||||
if (from_inv.type == InventoryLocation::PLAYER &&
|
if (from_inv.type == InventoryLocation::PLAYER &&
|
||||||
to_inv.type == InventoryLocation::PLAYER &&
|
from_inv == to_inv) {
|
||||||
from_inv.name == to_inv.name) {
|
|
||||||
PLAYER_TO_SA(player)->player_inventory_OnMove(
|
PLAYER_TO_SA(player)->player_inventory_OnMove(
|
||||||
*this, count, player);
|
*this, count, player);
|
||||||
} else {
|
} else {
|
||||||
|
@ -258,6 +258,7 @@ src/script/cpp_api/s_node.h
|
|||||||
src/script/cpp_api/s_nodemeta.cpp
|
src/script/cpp_api/s_nodemeta.cpp
|
||||||
src/script/cpp_api/s_nodemeta.h
|
src/script/cpp_api/s_nodemeta.h
|
||||||
src/script/cpp_api/s_player.cpp
|
src/script/cpp_api/s_player.cpp
|
||||||
|
src/script/cpp_api/s_player.h
|
||||||
src/script/cpp_api/s_security.cpp
|
src/script/cpp_api/s_security.cpp
|
||||||
src/script/cpp_api/s_security.h
|
src/script/cpp_api/s_security.h
|
||||||
src/script/cpp_api/s_server.cpp
|
src/script/cpp_api/s_server.cpp
|
||||||
|
Loading…
Reference in New Issue
Block a user