option between water plane / water trigger
[carveJwlIkooP6JGAAIwe30JlM.git] / skaterift_blender / sr_main.py
index 1f4910bef8aef8ef960f6d66416fdcb126c7d5b7..b715493167463135e4af8e39ea7f1c0691281261 100644 (file)
@@ -55,7 +55,7 @@ MDL_VERSION_NR = 106
 SR_TRIGGERABLE = [ 'ent_audio', 'ent_ccmd', 'ent_gate', 'ent_challenge', \
                    'ent_relay', 'ent_skateshop', 'ent_objective', 'ent_route',\
                    'ent_miniworld', 'ent_region', 'ent_glider', 'ent_list',\
-                   'ent_npc' ]
+                   'ent_npc', 'ent_water' ]
 
 def get_entity_enum_id( alias ):
 #{
@@ -338,6 +338,7 @@ class ent_water(Structure):
                ("max_dist",c_float),
                ("reserved0",c_uint32),
                ("reserved1",c_uint32)]
+   sr_functions = { 0: "drown" }
 #}
 
 class volume_trigger(Structure):
@@ -1781,6 +1782,9 @@ def sr_compile( collection ):
             else:
                worldinfo.timezone = obj_data.timezone
 
+            if obj_data.water_safe:
+               flags |= 0x2
+
             worldinfo.flags = flags
             worldinfo.pstr_skybox = sr_compile_string( obj_data.skybox )
             sr_ent_push( worldinfo )
@@ -3316,8 +3320,11 @@ class SR_OBJECT_ENT_WORLD_INFO(bpy.types.PropertyGroup):
    timezone: bpy.props.FloatProperty(name="Timezone(hrs) (UTC0 +hrs)")
    fixed_time: bpy.props.FloatProperty(name="Fixed Time (0-1)")
 
+   water_safe: bpy.props.BoolProperty(name="Water is Safe")
+
    @staticmethod
-   def sr_inspector( layout, data ):#{
+   def sr_inspector( layout, data ):
+   #{
       layout.prop( data[0], 'name' )
       layout.prop( data[0], 'desc' )
       layout.prop( data[0], 'author' )
@@ -3327,6 +3334,8 @@ class SR_OBJECT_ENT_WORLD_INFO(bpy.types.PropertyGroup):
          layout.prop( data[0], 'fixed_time' )
       else:
          layout.prop( data[0], 'timezone' )
+
+      layout.prop( data[0], 'water_safe' )
    #}
 #}