@@ -389,6 +389,9 @@ void CemuHooks::hook_EnableWeaponAttackSensor(PPCInterpreter_t* hCPU) {
389389 return ;
390390 }
391391
392+ // Weapons not currently bound to a VR hand (e.g. sheathed on back) must never
393+ // have their attack sensor activated, otherwise they cut grass / hit NPCs.
394+ bool isHandBoundWeapon = (weaponPtr == m_heldWeapons[0 ] || weaponPtr == m_heldWeapons[1 ]);
392395
393396 // AttackSensorInitArg arg = weapon.setupAttackSensor;
394397 // std::string attackSensorInitStr;
@@ -426,7 +429,7 @@ void CemuHooks::hook_EnableWeaponAttackSensor(PPCInterpreter_t* hCPU) {
426429
427430 // Use the analysed motion to determine whether the weapon is swinging or stabbing, and whether the attackSensor should be active this frame
428431 bool CHEAT_alwaysEnableWeaponCollision = false ;
429- if (isHeldByPlayer && (m_motionAnalyzers[heldIndex].IsAttacking () || CHEAT_alwaysEnableWeaponCollision)) {
432+ if (isHandBoundWeapon && isHeldByPlayer && (m_motionAnalyzers[heldIndex].IsAttacking () || CHEAT_alwaysEnableWeaponCollision)) {
430433 m_motionAnalyzers[heldIndex].SetHitboxEnabled (true );
431434 // Log::print("!! Activate sensor for {}: isHeldByPlayer={}, weaponType={}", heldIndex, isHeldByPlayer, (int)weaponType);
432435 weapon.setupAttackSensor .resetAttack = 1 ;
@@ -459,7 +462,7 @@ void CemuHooks::hook_EnableWeaponAttackSensor(PPCInterpreter_t* hCPU) {
459462
460463 writeMemory (weaponPtr, &weapon);
461464 }
462- else if (m_motionAnalyzers[heldIndex].IsHitboxEnabled ()) {
465+ else if (!isHandBoundWeapon || m_motionAnalyzers[heldIndex].IsHitboxEnabled ()) {
463466 m_motionAnalyzers[heldIndex].SetHitboxEnabled (false );
464467 // Log::print("!! Deactivate sensor for {}: isHeldByPlayer={}, weaponType={}", heldIndex, isHeldByPlayer, (int)weaponType);
465468
0 commit comments