Constrained weapon behavior to client side only
This commit is contained in:
@@ -242,8 +242,10 @@ private:
|
|||||||
// Spawn the weapon(s)
|
// Spawn the weapon(s)
|
||||||
EntityWrapper firstPersonWeapon;
|
EntityWrapper firstPersonWeapon;
|
||||||
EntityWrapper thirdPersonWeapon;
|
EntityWrapper thirdPersonWeapon;
|
||||||
if (firstPersonAttachment.Valid()) {
|
if (IsClient) {
|
||||||
firstPersonWeapon = SpawnerSystem::Spawn(firstPersonAttachment, firstPersonAttachment);
|
if (firstPersonAttachment.Valid()) {
|
||||||
|
firstPersonWeapon = SpawnerSystem::Spawn(firstPersonAttachment, firstPersonAttachment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (thirdPersonAttachment.Valid()) {
|
if (thirdPersonAttachment.Valid()) {
|
||||||
thirdPersonWeapon = SpawnerSystem::Spawn(thirdPersonAttachment, thirdPersonAttachment);
|
thirdPersonWeapon = SpawnerSystem::Spawn(thirdPersonAttachment, thirdPersonAttachment);
|
||||||
|
|||||||
@@ -117,11 +117,12 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi)
|
|||||||
|
|
||||||
// Play animation
|
// Play animation
|
||||||
playAnimationAndReturn(wi.FirstPersonEntity, "BlendTreeAssaultWeapon", "Reload");
|
playAnimationAndReturn(wi.FirstPersonEntity, "BlendTreeAssaultWeapon", "Reload");
|
||||||
|
if (IsClient) {
|
||||||
// Spawn explosion effect
|
// Spawn explosion effect
|
||||||
EntityWrapper reloadEffectSpawner = wi.FirstPersonEntity.FirstChildByName("FirstPersonReloadSpawner");
|
EntityWrapper reloadEffectSpawner = wi.FirstPersonEntity.FirstChildByName("FirstPersonReloadSpawner");
|
||||||
if (reloadEffectSpawner.Valid()) {
|
if (reloadEffectSpawner.Valid()) {
|
||||||
SpawnerSystem::Spawn(reloadEffectSpawner, reloadEffectSpawner);
|
SpawnerSystem::Spawn(reloadEffectSpawner, reloadEffectSpawner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user