aboutsummaryrefslogtreecommitdiff
path: root/textures/base/pack/minimap_btn.png
diff options
context:
space:
mode:
authorVicente Carrasco Alvarez <vicente.carrasco@usach.cl>2019-11-01 22:06:35 +0000
committerrubenwardy <rw@rubenwardy.com>2020-01-10 18:57:45 +0000
commit93db4be7268ac7ffd5745feefa019f608fa39b82 (patch)
tree939e5d0bfcd8d6c1d3d219e57b13ddf6c4fbc4a9 /textures/base/pack/minimap_btn.png
parent1f419ad19fd96f162c1f74d7980553d6c3518307 (diff)
downloadminetest-93db4be7268ac7ffd5745feefa019f608fa39b82.tar.gz
minetest-93db4be7268ac7ffd5745feefa019f608fa39b82.tar.bz2
minetest-93db4be7268ac7ffd5745feefa019f608fa39b82.zip
Translated using Weblate (Spanish)
Currently translated at 61.5% (783 of 1274 strings)
Diffstat (limited to 'textures/base/pack/minimap_btn.png')
0 files changed, 0 insertions, 0 deletions
='n129' href='#n129'>129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
/*
Minetest
Copyright (C) 2010-2020 Minetest core development team

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "serverinventorymgr.h"
#include "map.h"
#include "nodemetadata.h"
#include "player_sao.h"
#include "remoteplayer.h"
#include "server.h"
#include "serverenvironment.h"

ServerInventoryManager::ServerInventoryManager() : InventoryManager()
{
}

ServerInventoryManager::~ServerInventoryManager()
{
	// Delete detached inventories
	for (auto &detached_inventory : m_detached_inventories) {
		delete detached_inventory.second.inventory;
	}
}

Inventory *ServerInventoryManager::getInventory(const InventoryLocation &loc)
{
	switch (loc.type) {
	case InventoryLocation::UNDEFINED:
	case InventoryLocation::CURRENT_PLAYER:
		break;
	case InventoryLocation::PLAYER: {
		RemotePlayer *player = m_env->getPlayer(loc.name.c_str());
		if (!player)
			return NULL;
		PlayerSAO *playersao = player->getPlayerSAO();
		if (!playersao)
			return NULL;
		return playersao->getInventory();