Skip to content

Commit dc0acae

Browse files
revolucasXottab-DUTY
authored andcommitted
= fix rpm for abakan cycle down
= fix level.get_target_dist to always return range even if there is no object at cursor + added level.get_target_element which should return bone id
1 parent a31a78b commit dc0acae

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/xrGame/WeaponMagazined.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,10 @@ void CWeaponMagazined::state_Fire(float dt)
545545

546546
//Alundaio: Use fModeShotTime instead of fOneShotTime if current fire mode is 2-shot burst
547547
//Alundaio: Cycle down RPM after two shots; used for Abakan/AN-94
548-
float rpm = fOneShotTime;
549548
if (GetCurrentFireMode() == 2 || (cycleDown == true && m_iShotNum <= 1))
550-
rpm = modeShotTime;
551-
552-
fShotTimeCounter += rpm;
549+
fShotTimeCounter = modeShotTime;
550+
else
551+
fShotTimeCounter = fOneShotTime;
553552
//Alundaio: END
554553

555554
++m_iShotNum;

src/xrGame/level_script.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,11 +617,20 @@ CScriptGameObject* g_get_target_obj()
617617
float g_get_target_dist()
618618
{
619619
collide::rq_result& RQ = HUD().GetCurrentRayQuery();
620-
if (RQ.O)
620+
if (RQ.range)
621621
return RQ.range;
622622
return 0.f;
623623
}
624624

625+
u32 g_get_target_element()
626+
{
627+
collide::rq_result& RQ = HUD().GetCurrentRayQuery();
628+
if (RQ.element)
629+
return RQ.element;
630+
631+
return 0;
632+
}
633+
625634
//-Alundaio
626635

627636
IC static void CLevel_Export(lua_State* luaState)
@@ -638,6 +647,7 @@ IC static void CLevel_Export(lua_State* luaState)
638647
//def("ray_pick",g_ray_pick),
639648
def("get_target_obj", &g_get_target_obj), //intentionally named to what is in xray extensions
640649
def("get_target_dist", &g_get_target_dist),
650+
def("get_target_element", &g_get_target_element), //Can get bone cursor is targetting
641651
def("spawn_item", &spawn_section),
642652
//Alundaio: END
643653
// obsolete\deprecated

0 commit comments

Comments
 (0)