Kaynağa Gözat

fix problems when state-cache 0 is defined

David Rose 18 yıl önce
ebeveyn
işleme
6250baff3b
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      panda/src/egg2pg/eggRenderState.cxx

+ 6 - 1
panda/src/egg2pg/eggRenderState.cxx

@@ -421,7 +421,12 @@ fill_state(EggPrimitive *egg_prim) {
 int EggRenderState::
 int EggRenderState::
 compare_to(const EggRenderState &other) const {
 compare_to(const EggRenderState &other) const {
   if (_state != other._state) {
   if (_state != other._state) {
-    return _state < other._state ? -1 : 1;
+    if ((*_state) < (*other._state)) {
+      return -1;
+    }
+    if ((*other._state) < (*_state)) {
+      return 1;
+    }
   }
   }
   if (_hidden != other._hidden) {
   if (_hidden != other._hidden) {
     return (int)_hidden - (int)other._hidden;
     return (int)_hidden - (int)other._hidden;