Returns whether this weapon can use obstruction instead of weapon lift. Implement simple conditions only (e.g. checking for attachments, weapon types, ...) to prevent possible desyncs.
1380 {
1381 HumanMovementState ms = new HumanMovementState();
1382 player.GetMovementState(ms);
1383
1384 #ifdef DIAG_DEVELOPER
1385 if (DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 2)
1386 return true;
1387 if (DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 6)
1388 return false;
1389 #endif
1390
1391
1392
1394 {
1395 return false;
1396 }
1397
1398
1399
1400 bool isDynamic;
1401 bool isStatic;
1402 if (hitObject)
1403 {
1405 isStatic = !isDynamic;
1406 }
1407
1408 #ifdef DIAG_DEVELOPER
1409
1410 bool diagAlwaysDynamic = DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 3 || DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 5;
1411 if (diagAlwaysDynamic && isDynamic)
1412 return true;
1413
1414
1415 bool diagNeverStatic = DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 4 || DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 5;
1416 if (diagNeverStatic && isStatic)
1417 return false;
1418 #endif
1419
1420
1423 if (hitObject)
1424 {
1426 {
1427 return false;
1428 }
1430 {
1431 return true;
1432 }
1433 }
1434 else if (obstructionValue > 0)
1435 {
1436
1438 }
1440
1441
1442
1443
1444 bool isLift = player.IsLiftWeapon();
1445
1446 if (isLift && obstructionValue > 0.9)
1447 {
1448 return false;
1449 }
1450
1451 if (!isLift && obstructionValue >= 1.0)
1452 {
1453 return false;
1454 }
1455
1456 #ifdef DIAG_DEVELOPER
1457 if (DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 1)
1458 return true;
1459 #endif
1460
1461
1463 }
EWeaponObstructionMode staticMode
!! all member variables must correspond with the cfggameplay.json file contents !!...
EWeaponObstructionMode dynamicMode
float m_ObstructionDistance
proto native bool dBodyIsDynamic(notnull IEntity ent)