Skip to content

Commit

Permalink
Add NPC weapon use hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Drombeys committed Mar 4, 2025
1 parent 41db10a commit b5692de
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/xrGame/inventory_item_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "StdAfx.h"
#include "pch_script.h"
#include "inventory_item_object.h"
#include "../Include/xrRender/Kinematics.h"
#include "../Include/xrRender/KinematicsAnimated.h"


CInventoryItemObject::CInventoryItemObject ()
Expand Down Expand Up @@ -97,6 +99,17 @@ BOOL CInventoryItemObject::net_Spawn (CSE_Abstract* DC)
{
BOOL res = CPhysicItem::net_Spawn(DC);
CInventoryItem::net_Spawn (DC);
auto pKA = Visual()->dcast_PKinematicsAnimated();
if (pKA != nullptr)
{
auto motionId = pKA->ID_Cycle_Safe("idle");
if (!motionId)
{
motionId.set(0, 0);
}

pKA->PlayCycle(motionId, false);
}
return (res);
}

Expand Down

0 comments on commit b5692de

Please sign in to comment.