|
7 | 7 | #include "static_cast_checked.hpp" |
8 | 8 | #include "actoreffector.h" |
9 | 9 | #include "xrEngine/IGame_Persistent.h" |
| 10 | +#include "xrCore/xrDebug_macros.h" // only for pragma todo |
| 11 | + |
10 | 12 |
|
11 | 13 | player_hud* g_player_hud = nullptr; |
12 | 14 | Fvector _ancor_pos; |
@@ -366,20 +368,21 @@ u32 attachable_hud_item::anim_play(const shared_str& anm_name_b, BOOL bMixIn, co |
366 | 368 | VERIFY(current_actor); |
367 | 369 | CEffectorCam* ec = current_actor->Cameras().GetCamEffector(eCEWeaponAction); |
368 | 370 |
|
369 | | - if (nullptr == ec) |
| 371 | + if (ec) |
| 372 | + current_actor->Cameras().RemoveCamEffector(eCEWeaponAction); |
| 373 | + |
| 374 | + string_path ce_path; |
| 375 | + string_path anm_name; |
| 376 | +#pragma todo("Xottab_DUTY: replace backslashes with slashes") |
| 377 | + strconcat(sizeof(anm_name), anm_name, "camera_effects\\weapon\\", M.name.c_str(), ".anm"); |
| 378 | + if (FS.exist(ce_path, "$game_anims$", anm_name)) |
370 | 379 | { |
371 | | - string_path ce_path; |
372 | | - string_path anm_name; |
373 | | - strconcat(sizeof(anm_name), anm_name, "camera_effects\\weapon\\", M.name.c_str(), ".anm"); |
374 | | - if (FS.exist(ce_path, "$game_anims$", anm_name)) |
375 | | - { |
376 | | - CAnimatorCamEffector* e = new CAnimatorCamEffector(); |
377 | | - e->SetType(eCEWeaponAction); |
378 | | - e->SetHudAffect(false); |
379 | | - e->SetCyclic(false); |
380 | | - e->Start(anm_name); |
381 | | - current_actor->Cameras().AddCamEffector(e); |
382 | | - } |
| 380 | + CAnimatorCamEffector* e = new CAnimatorCamEffector(); |
| 381 | + e->SetType(eCEWeaponAction); |
| 382 | + e->SetHudAffect(false); |
| 383 | + e->SetCyclic(false); |
| 384 | + e->Start(anm_name); |
| 385 | + current_actor->Cameras().AddCamEffector(e); |
383 | 386 | } |
384 | 387 | } |
385 | 388 | return ret; |
|
0 commit comments