diff options
author | est31 <MTest31@outlook.com> | 2015-06-20 03:20:06 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-06-20 03:37:30 +0200 |
commit | dd91b3d6fbc3a0b4b18b36b14864d703213dd622 (patch) | |
tree | 0c73f02ef3357f9557694d489a42df424fab51fc /src/mapblock.cpp | |
parent | 40226e52747156cbdc5128a416480b226e498fff (diff) | |
download | minetest-dd91b3d6fbc3a0b4b18b36b14864d703213dd622.tar.gz minetest-dd91b3d6fbc3a0b4b18b36b14864d703213dd622.tar.bz2 minetest-dd91b3d6fbc3a0b4b18b36b14864d703213dd622.zip |
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
Diffstat (limited to 'src/mapblock.cpp')
-rw-r--r-- | src/mapblock.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 9eb64a76e..39cac0b60 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -465,11 +465,11 @@ s16 MapBlock::getGroundLevel(v2s16 p2d) // sure we can handle all content ids. But it's absolutely worth it as it's // a speedup of 4 for one of the major time consuming functions on storing // mapblocks. -static content_t getBlockNodeIdMapping_mapping[USHRT_MAX]; +static content_t getBlockNodeIdMapping_mapping[USHRT_MAX + 1]; static void getBlockNodeIdMapping(NameIdMapping *nimap, MapNode *nodes, INodeDefManager *nodedef) { - memset(getBlockNodeIdMapping_mapping, 0xFF, USHRT_MAX * sizeof(content_t)); + memset(getBlockNodeIdMapping_mapping, 0xFF, (USHRT_MAX + 1) * sizeof(content_t)); std::set<content_t> unknown_contents; content_t id_counter = 0; |