@@ -53,7 +53,7 @@ function door_init(id) -- NORMAL doors only!
5353 setEntityActivity (object_id , 1 );
5454
5555 entity_funcs [id ].onActivate = function (object_id , activator_id )
56- local a , f , c = getEntityAnim (object_id );
56+ local a , f , c = getEntityAnim (object_id , ANIM_TYPE_BASE );
5757 if (c == 1 ) then
5858 return swapEntityState (object_id , 0 , 1 );
5959 end ;
@@ -306,8 +306,10 @@ function heli_rig_TR2_init(id) -- Helicopter in Offshore Rig (TR2)
306306 if (getEntityAnimState (object_id , ANIM_TYPE_BASE ) ~= 2 ) then
307307 setEntityAnimState (object_id , ANIM_TYPE_BASE , 2 );
308308 else
309- local anim , frame , count = getEntityAnim (object_id );
310- if (frame == count - 1 ) then disableEntity (object_id ) end ;
309+ local anim , frame , count = getEntityAnim (object_id , ANIM_TYPE_BASE );
310+ if (frame == count - 1 ) then
311+ disableEntity (object_id )
312+ end ;
311313 end
312314 end ;
313315 end
@@ -614,7 +616,7 @@ function wallblade_init(id) -- Wall blade (TR1-TR3)
614616
615617 entity_funcs [id ].onLoop = function (object_id )
616618 if (tickEntity (object_id ) == TICK_STOPPED ) then setEntityActivity (object_id , 0 ) end ;
617- local anim_number = getEntityAnim (object_id );
619+ local anim_number = getEntityAnim (object_id , ANIM_TYPE_BASE );
618620 if (anim_number == 2 ) then
619621 setEntityAnim (object_id , ANIM_TYPE_BASE , 3 , 0 );
620622 elseif (anim_number == 1 ) then
@@ -695,7 +697,7 @@ function pickup_init(id, item_id) -- Pick-ups
695697 end
696698
697699 local need_set_pos = true ;
698- local curr_anim = getEntityAnim (activator_id );
700+ local curr_anim = getEntityAnim (activator_id , ANIM_TYPE_BASE );
699701
700702 if (curr_anim == 103 ) then -- Stay idle
701703 local dx , dy , dz = getEntityVector (object_id , activator_id );
@@ -729,7 +731,7 @@ function pickup_init(id, item_id) -- Pick-ups
729731 end ;
730732 end ;
731733
732- local a , f , c = getEntityAnim (activator_id );
734+ local a , f , c = getEntityAnim (activator_id , ANIM_TYPE_BASE );
733735 -- Standing pickup anim makes action on frame 40 in TR1-3, in TR4-5
734736 -- it was generalized with all rest animations by frame 16.
735737 if ((a == 135 ) and (getLevelVersion () < TR_IV )) then
@@ -776,14 +778,14 @@ function fallblock_init(id) -- Falling block (TR1-3)
776778 return ;
777779 end
778780
779- local anim = getEntityAnim (object_id );
781+ local anim = getEntityAnim (object_id , ANIM_TYPE_BASE );
780782 if (anim == 0 ) then
781783 setEntityAnim (object_id , ANIM_TYPE_BASE , 1 , 0 );
782784 -- print("you trapped to id = "..object_id);
783785 local once = true ;
784786 addTask (
785787 function ()
786- local anim = getEntityAnim (object_id );
788+ local anim = getEntityAnim (object_id , ANIM_TYPE_BASE );
787789 if (anim == 1 ) then
788790 return true ;
789791 end ;
@@ -815,7 +817,7 @@ function fallceiling_init(id) -- Falling ceiling (TR1-3)
815817 return ENTITY_TRIGGERING_NOT_READY ;
816818 end
817819
818- local anim = getEntityAnim (object_id );
820+ local anim = getEntityAnim (object_id , ANIM_TYPE_BASE );
819821 if (anim == 0 ) then
820822 setEntityAnim (object_id , ANIM_TYPE_BASE , 1 , 0 );
821823 setEntityVisibility (object_id , 1 );
@@ -834,7 +836,7 @@ function fallceiling_init(id) -- Falling ceiling (TR1-3)
834836 end ;
835837
836838 entity_funcs [id ].onCollide = function (object_id , activator_id )
837- if ((getEntityAnim (object_id ) == 1 ) and (getEntityModelID (activator_id ) == 0 ) and (getCharacterParam (activator_id , PARAM_HEALTH ) > 0 )) then
839+ if ((getEntityAnim (object_id , ANIM_TYPE_BASE ) == 1 ) and (getEntityModelID (activator_id ) == 0 ) and (getCharacterParam (activator_id , PARAM_HEALTH ) > 0 )) then
838840 setCharacterParam (activator_id , PARAM_HEALTH , 0 );
839841 end ;
840842 end
@@ -872,11 +874,11 @@ function midastouch_init(id) -- Midas gold touch
872874
873875 entity_funcs [id ].onLoop = function (object_id )
874876 if (getEntityDistance (player , object_id ) < 1024.0 ) then
875- local lara_anim , frame , count = getEntityAnim (player );
877+ local lara_anim , frame , count = getEntityAnim (player , ANIM_TYPE_BASE );
876878 local lara_sector = getEntitySectorIndex (player );
877879 local hand_sector = getEntitySectorIndex (object_id );
878880
879- if ((lara_sector == hand_sector ) and (getEntityMoveType (player ) == MOVE_ON_FLOOR ) and (getEntityAnim ( player ) ~= 50 )) then
881+ if ((lara_sector == hand_sector ) and (getEntityMoveType (player ) == MOVE_ON_FLOOR ) and (lara_anim ~= 50 )) then
880882 setCharacterParam (player , PARAM_HEALTH , 0 );
881883 entitySSAnimEnsureExists (player , ANIM_TYPE_MISK_1 , 5 ); -- ANIM_TYPE_MISK_1 - add const
882884 setEntityAnim (player , ANIM_TYPE_MISK_1 , 1 , 0 );
0 commit comments