only works on some feeders
| 2671 | |
| 2672 | //only works on some feeders |
| 2673 | int GetCurrentFeederIndex(itemDef_t * item) |
| 2674 | { |
| 2675 | float feederID = item->special; |
| 2676 | const char * name; |
| 2677 | int i, max; |
| 2678 | |
| 2679 | if (feederID == FEEDER_PLAYER_SPECIES) |
| 2680 | { |
| 2681 | return uiInfo.playerSpeciesIndex; |
| 2682 | } |
| 2683 | if (feederID == FEEDER_PLAYER_SKIN_HEAD) |
| 2684 | { |
| 2685 | name = Cvar_VariableString("ui_char_skin_head"); |
| 2686 | max = uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinHeadCount; |
| 2687 | for ( i = 0; i < max ; i++) |
| 2688 | { |
| 2689 | if (!Q_stricmp(name, uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinHead[i].name)) |
| 2690 | { |
| 2691 | return i; |
| 2692 | } |
| 2693 | |
| 2694 | // Cvar_Set("ui_char_skin_head", uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinHeadNames[index]); |
| 2695 | } |
| 2696 | return -1; |
| 2697 | } |
| 2698 | else if (feederID == FEEDER_PLAYER_SKIN_TORSO) |
| 2699 | { |
| 2700 | name = Cvar_VariableString("ui_char_skin_torso"); |
| 2701 | max = uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinTorsoCount; |
| 2702 | for ( i = 0; i < max ; i++) |
| 2703 | { |
| 2704 | if (!Q_stricmp(name, uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinTorso[i].name)) |
| 2705 | { |
| 2706 | return i; |
| 2707 | } |
| 2708 | // Cvar_Set("ui_char_skin_head", uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinHeadNames[index]); |
| 2709 | } |
| 2710 | return -1; |
| 2711 | |
| 2712 | } |
| 2713 | else if (feederID == FEEDER_PLAYER_SKIN_LEGS) |
| 2714 | { |
| 2715 | name = Cvar_VariableString("ui_char_skin_legs"); |
| 2716 | max = uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinLegCount; |
| 2717 | for ( i = 0; i < max ; i++) |
| 2718 | { |
| 2719 | if (!Q_stricmp(name, uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinLeg[i].name)) |
| 2720 | { |
| 2721 | return i; |
| 2722 | } |
| 2723 | // Cvar_Set("ui_char_skin_head", uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinHeadNames[index]); |
| 2724 | } |
| 2725 | return -1; |
| 2726 | |
| 2727 | |
| 2728 | // if (index >= 0 && index < uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinLegCount) |
| 2729 | // { |
| 2730 | // Cvar_Set("ui_char_skin_legs", uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinLegNames[index]); |
no test coverage detected