Преглед на файлове

fix problems when state-cache 0 is defined

David Rose преди 18 години
родител
ревизия
6250baff3b
променени са 1 файла, в които са добавени 6 реда и са изтрити 1 реда
  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::
 compare_to(const EggRenderState &other) const {
   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) {
     return (int)_hidden - (int)other._hidden;