@@ -441,20 +441,20 @@ function util.set_phys_info(entity, data, fps)
441441    local  has_set  =  false 
442442    for  i , phys_component  in  ipairs (EntityGetComponent (entity , " PhysicsBodyComponent" or  {}) do 
443443        local  phys_info  =  phys_infos [i ]
444-         if  phys_component  ~=  nil  and  phys_component  ~=  0  and  phys_info  ~=  nil  then 
444+         if  phys_component  ~=  nil  and  phys_component  ~=  0  and  phys_info  ~=  nil 
445+                 and  ComponentGetValue2 (phys_component , " mPixelCount" ~=  0  then 
445446            deserialize_phys_component (phys_component , phys_info , fps )
446447            has_set  =  true 
447448        end 
448449    end 
449450    for  i , phys_component  in  ipairs (EntityGetComponent (entity , " PhysicsBody2Component" or  {}) do 
450451        local  phys_info  =  phys_infos_2 [i ]
451-         if  phys_component  ~=  nil  and  phys_component  ~=  0  and  phys_info  ~=  nil  then 
452-             --  A physics body doesn't exist otherwise, causing a crash
453-             local  initialized  =  ComponentGetValue2 (phys_component , " mInitialized" 
454-             if  initialized  then 
455-                 deserialize_phys_component (phys_component , phys_info , fps )
456-                 has_set  =  true 
457-             end 
452+         if  phys_component  ~=  nil  and  phys_component  ~=  0  and  phys_info  ~=  nil 
453+                 and  ComponentGetValue2 (phys_component , " mPixelCount" ~=  0 
454+                 --  A physics body doesn't exist otherwise, causing a crash
455+                 and  ComponentGetValue2 (phys_component , " mInitialized" then 
456+             deserialize_phys_component (phys_component , phys_info , fps )
457+             has_set  =  true 
458458        end 
459459    end 
460460    return  has_set 
0 commit comments