Skip to content

Instantly share code, notes, and snippets.

@appgurueu
Last active January 23, 2024 21:28
Show Gist options
  • Save appgurueu/daaf1cf647fcd89d531287339d3b4e9f to your computer and use it in GitHub Desktop.
Save appgurueu/daaf1cf647fcd89d531287339d3b4e9f to your computer and use it in GitHub Desktop.
Restore pointability backwards compatibility
diff --git a/src/util/pointabilities.h b/src/util/pointabilities.h
index 4acc1ddb7..1ad57143b 100644
--- a/src/util/pointabilities.h
+++ b/src/util/pointabilities.h
@@ -26,8 +26,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
enum class PointabilityType : u8
{
+ // Can be pointed through.
+ // Note: This MUST be the 0-th item in the enum for backwards compat.
+ // Older Minetest versions send "pointable=false" as "0".
+ POINTABLE_NOT,
+ // Is pointable.
+ // Note: This MUST be the 1-th item in the enum for backwards compat:
+ // Older Minetest versions send "pointable=true" as "1".
POINTABLE,
- POINTABLE_NOT, // Can be pointed through.
+ // Note: Since (u8) 2 is truthy,
+ // older clients will understand this as "pointable=true",
+ // which is a reasonable fallback.
POINTABLE_BLOCKING,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment