[Bf-blender-cvs] [f320724] master: BGE: Fix invalid operator< for microsoft compiler.

Porteries Tristan noreply at git.blender.org
Wed Dec 30 13:47:46 CET 2015


Commit: f320724195e3ec045781d5331955be866c821b4f
Author: Porteries Tristan
Date:   Wed Dec 30 13:27:30 2015 +0100
Branches: master
https://developer.blender.org/rBf320724195e3ec045781d5331955be866c821b4f

BGE: Fix invalid operator< for microsoft compiler.

It fixes the strict weak ordering assertion failure, see : https://support.microsoft.com/en-us/kb/949171.
sybren and youle are the author of this commit.

===================================================================

M	source/gameengine/Ketsji/KX_TouchEventManager.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp
index eb77496..7f16765 100644
--- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp
+++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp
@@ -235,5 +235,12 @@ KX_TouchEventManager::NewCollision::NewCollision(const NewCollision &to_copy)
 
 bool KX_TouchEventManager::NewCollision::operator<(const NewCollision &other) const
 {
-	return first < other.first || second < other.second || colldata < other.colldata;
+	//see strict weak ordering: https://support.microsoft.com/en-us/kb/949171
+	if (first == other.first) {
+		if (second == other.second) {
+			return colldata < other.colldata;
+		}
+		return second < other.second;
+	}
+	return first < other.first;
 }




More information about the Bf-blender-cvs mailing list