FIXME: need a mindist for explosive weapons
| 1469 | |
| 1470 | //FIXME: need a mindist for explosive weapons |
| 1471 | float NPC_MaxDistSquaredForWeapon (void) |
| 1472 | { |
| 1473 | if(NPCInfo->stats.shootDistance > 0) |
| 1474 | {//overrides default weapon dist |
| 1475 | return NPCInfo->stats.shootDistance * NPCInfo->stats.shootDistance; |
| 1476 | } |
| 1477 | |
| 1478 | switch ( NPC->s.weapon ) |
| 1479 | { |
| 1480 | case WP_BLASTER://scav rifle |
| 1481 | return 1024 * 1024;//should be shorter? |
| 1482 | break; |
| 1483 | |
| 1484 | case WP_BRYAR_PISTOL://prifle |
| 1485 | return 1024 * 1024; |
| 1486 | break; |
| 1487 | |
| 1488 | case WP_BLASTER_PISTOL://prifle |
| 1489 | return 1024 * 1024; |
| 1490 | break; |
| 1491 | |
| 1492 | case WP_DISRUPTOR://disruptor |
| 1493 | case WP_TUSKEN_RIFLE: |
| 1494 | if ( NPCInfo->scriptFlags & SCF_ALT_FIRE ) |
| 1495 | { |
| 1496 | return ( 4096 * 4096 ); |
| 1497 | } |
| 1498 | else |
| 1499 | { |
| 1500 | return 1024 * 1024; |
| 1501 | } |
| 1502 | break; |
| 1503 | /* |
| 1504 | case WP_SABER: |
| 1505 | return 1024 * 1024; |
| 1506 | break; |
| 1507 | */ |
| 1508 | case WP_SABER: |
| 1509 | if ( NPC->client && NPC->client->ps.SaberLength() ) |
| 1510 | {//FIXME: account for whether enemy and I are heading towards each other! |
| 1511 | return (NPC->client->ps.SaberLength() + NPC->maxs[0]*1.5)*(NPC->client->ps.SaberLength() + NPC->maxs[0]*1.5); |
| 1512 | } |
| 1513 | else |
| 1514 | { |
| 1515 | return 48*48; |
| 1516 | } |
| 1517 | break; |
| 1518 | |
| 1519 | default: |
| 1520 | return 1024 * 1024;//was 0 |
| 1521 | break; |
| 1522 | } |
| 1523 | } |
| 1524 | |
| 1525 | |
| 1526 |
no test coverage detected