================= Item_Multi_FindCvarByValue ================= */
| 10749 | ================= |
| 10750 | */ |
| 10751 | int Item_Multi_FindCvarByValue(itemDef_t *item) |
| 10752 | { |
| 10753 | char buff[1024]; |
| 10754 | float value = 0; |
| 10755 | int i; |
| 10756 | multiDef_t *multiPtr = (multiDef_t*)item->typeData; |
| 10757 | if (multiPtr) |
| 10758 | { |
| 10759 | if (multiPtr->strDef) |
| 10760 | { |
| 10761 | DC->getCVarString(item->cvar, buff, sizeof(buff)); |
| 10762 | } |
| 10763 | else |
| 10764 | { |
| 10765 | value = DC->getCVarValue(item->cvar); |
| 10766 | } |
| 10767 | for (i = 0; i < multiPtr->count; i++) |
| 10768 | { |
| 10769 | if (multiPtr->strDef) |
| 10770 | { |
| 10771 | if (Q_stricmp(buff, multiPtr->cvarStr[i]) == 0) |
| 10772 | { |
| 10773 | return i; |
| 10774 | } |
| 10775 | } |
| 10776 | else |
| 10777 | { |
| 10778 | if (multiPtr->cvarValue[i] == value) |
| 10779 | { |
| 10780 | return i; |
| 10781 | } |
| 10782 | } |
| 10783 | } |
| 10784 | } |
| 10785 | return 0; |
| 10786 | } |
| 10787 | |
| 10788 | /* |
| 10789 | ================= |
no test coverage detected