From dd91b3d6fbc3a0b4b18b36b14864d703213dd622 Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 20 Jun 2015 03:20:06 +0200 Subject: Generic CAO cleanups and renames for clarification * Use enum for GENERIC_CMD_* * Rename m_attachements to attachement_parent_ids (public member and clearer name) * Rename GENERIC_CMD_SET_ATTACHMENT to GENERIC_CMD_ATTACH_TO * USHRT_MAX + 1 buffer sizes to prevent overflows as @kahrl suggested * Remove unneccessary m_id from GenericCAO (shadowing protected superclass member for no reason) as @kahrl suggested --- src/genericobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/genericobject.cpp') diff --git a/src/genericobject.cpp b/src/genericobject.cpp index 78dc7fa91..5daba55ed 100644 --- a/src/genericobject.cpp +++ b/src/genericobject.cpp @@ -161,7 +161,7 @@ std::string gob_cmd_update_attachment(int parent_id, std::string bone, v3f posit { std::ostringstream os(std::ios::binary); // command - writeU8(os, GENERIC_CMD_SET_ATTACHMENT); + writeU8(os, GENERIC_CMD_ATTACH_TO); // parameters writeS16(os, parent_id); os<