void NPC_Precache ( char *NPCName ) Precaches NPC skins, tgas and md3s. */
| 1576 | |
| 1577 | */ |
| 1578 | void CG_NPC_Precache ( gentity_t *spawner ) |
| 1579 | { |
| 1580 | clientInfo_t ci={}; |
| 1581 | renderInfo_t ri={}; |
| 1582 | team_t playerTeam = TEAM_FREE; |
| 1583 | const char *token; |
| 1584 | const char *value; |
| 1585 | const char *p; |
| 1586 | char *patch; |
| 1587 | char sound[MAX_QPATH]; |
| 1588 | qboolean md3Model = qfalse; |
| 1589 | char playerModel[MAX_QPATH] = { 0 }; |
| 1590 | char customSkin[MAX_QPATH]; |
| 1591 | |
| 1592 | if ( !Q_stricmp( "random", spawner->NPC_type ) ) |
| 1593 | {//sorry, can't precache a random just yet |
| 1594 | return; |
| 1595 | } |
| 1596 | |
| 1597 | strcpy(customSkin,"default"); |
| 1598 | |
| 1599 | p = NPCParms; |
| 1600 | COM_BeginParseSession(); |
| 1601 | |
| 1602 | // look for the right NPC |
| 1603 | while ( p ) |
| 1604 | { |
| 1605 | token = COM_ParseExt( &p, qtrue ); |
| 1606 | if ( token[0] == 0 ) |
| 1607 | { |
| 1608 | COM_EndParseSession( ); |
| 1609 | return; |
| 1610 | } |
| 1611 | |
| 1612 | if ( !Q_stricmp( token, spawner->NPC_type ) ) |
| 1613 | { |
| 1614 | break; |
| 1615 | } |
| 1616 | |
| 1617 | SkipBracedSection( &p ); |
| 1618 | } |
| 1619 | |
| 1620 | if ( !p ) |
| 1621 | { |
| 1622 | COM_EndParseSession( ); |
| 1623 | return; |
| 1624 | } |
| 1625 | |
| 1626 | if ( G_ParseLiteral( &p, "{" ) ) |
| 1627 | { |
| 1628 | COM_EndParseSession( ); |
| 1629 | return; |
| 1630 | } |
| 1631 | |
| 1632 | // parse the NPC info block |
| 1633 | while ( 1 ) |
| 1634 | { |
| 1635 | COM_EndParseSession(); // if still in session (or using continue;) |
no test coverage detected