aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-10-02 19:11:27 +0200
committerGitHub <noreply@github.com>2019-10-02 19:11:27 +0200
commit81c2370c8b1a66a279a5ff450c78caf5dfef77bf (patch)
treedafd49bfa912783985b5a58713805027f06322b4 /cmake/Modules
parent251038e136f22f29999bd938e6c9e9f1a5269243 (diff)
downloadminetest-81c2370c8b1a66a279a5ff450c78caf5dfef77bf.tar.gz
minetest-81c2370c8b1a66a279a5ff450c78caf5dfef77bf.tar.bz2
minetest-81c2370c8b1a66a279a5ff450c78caf5dfef77bf.zip
Attachments: Fix attachments to temporary removed objects (#8989)
Does not clear the parent's attachment information when the child is deleted locally. Either it was removed permanently, or just temporary - we don't know, but it's up to the server to send a *detach from child" packet for the parent.
Diffstat (limited to 'cmake/Modules')
0 files changed, 0 insertions, 0 deletions
25' href='#n125'>125 126 127 128 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 205 206 207 208 209 210 211 212 213
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

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 "tool.h"
#include "itemgroup.h"
#include "log.h"
#include "inventory.h"
#include "exceptions.h"
#include "util/serialize.h"
#include "util/numeric.h"

void ToolCapabilities::serialize(std::ostream &os, u16 protocol_version) const
{
	if(protocol_version <= 17)
		writeU8(os, 1); // version
	else
		writeU8(os, 2); // version
	writeF1000(os, full_punch_interval);
	writeS16(os, max_drop_level);
	writeU32(os, groupcaps.size());
	for (ToolGCMap::const_iterator i = groupcaps.begin(); i != groupcaps.end(); ++i) {
		const std::string *name = &i->first;
		const ToolGroupCap *cap = &i->second;
		os<<serializeString(*name);
		writeS16(os, cap->uses);
		writeS16(os, cap->maxlevel);
		writeU32(os, cap->times.size());
		for (UNORDERED_MAP<int, float>::const_iterator