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.
1386 {
1387 HumanMovementState ms = new HumanMovementState();
1388 player.GetMovementState(ms);
1389
1390 #ifdef DIAG_DEVELOPER
1391 if (DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 2)
1392 return true;
1393 if (DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 6)
1394 return false;
1395 #endif
1396
1397
1398
1400 {
1401 return false;
1402 }
1403
1404
1405
1406 bool isDynamic;
1407 bool isStatic;
1408 if (hitObject)
1409 {
1411 isStatic = !isDynamic;
1412 }
1413
1414 #ifdef DIAG_DEVELOPER
1415
1416 bool diagAlwaysDynamic = DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 3 || DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 5;
1417 if (diagAlwaysDynamic && isDynamic)
1418 return true;
1419
1420
1421 bool diagNeverStatic = DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 4 || DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 5;
1422 if (diagNeverStatic && isStatic)
1423 return false;
1424 #endif
1425
1426
1429 if (hitObject)
1430 {
1432 {
1433 return false;
1434 }
1436 {
1437 return true;
1438 }
1439 }
1440 else if (obstructionValue > 0)
1441 {
1442
1444 }
1446
1447
1448
1449
1450 bool isLift = player.IsLiftWeapon();
1451
1452 if (isLift && obstructionValue > 0.9)
1453 {
1454 return false;
1455 }
1456
1457 if (!isLift && obstructionValue >= 1.0)
1458 {
1459 return false;
1460 }
1461
1462 #ifdef DIAG_DEVELOPER
1463 if (DiagMenu.GetValue(
DiagMenuIDs.WEAPON_FORCEALLOW_OBSTRUCTION) == 1)
1464 return true;
1465 #endif
1466
1467
1469 }
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)