Last change
on this file since 1107 was 994, checked in by alloc, 11 years ago |
Daodan:
- Fix #80
- Reorganization of file hierarchy
|
File size:
1.4 KB
|
Line | |
---|
1 | #include <stdlib.h>
|
---|
2 | #include "Character.h"
|
---|
3 |
|
---|
4 | #include "../Oni/Oni.h"
|
---|
5 |
|
---|
6 | int DDr_TeamToTeamID(const char* team_string) //Already something like this in the engine, but I'm reimplementing it...
|
---|
7 | {
|
---|
8 | if (!strcmp(team_string, "Konoko")) return team_konoko;
|
---|
9 | else if (!strcmp(team_string, "TCTF")) return team_tctf;
|
---|
10 | else if (!strcmp(team_string, "Syndicate")) return team_syndicate;
|
---|
11 | else if (!strcmp(team_string, "Neutral")) return team_neutral;
|
---|
12 | else if (!strcmp(team_string, "SecurityGuard")) return team_securityguard;
|
---|
13 | else if (!strcmp(team_string, "RogueKonoko")) return team_roguekonoko;
|
---|
14 | else if (!strcmp(team_string, "Switzerland")) return team_switzerland;
|
---|
15 | else if (!strcmp(team_string, "SyndicateAccessory")) return team_syndicateaccessory;
|
---|
16 | return team_neutral; //if you enter a bad teamname, return Neutral.....
|
---|
17 | }
|
---|
18 |
|
---|
19 | uint32_t DDrGetCharacterIndexFromName(char* input) {
|
---|
20 | int i;
|
---|
21 | Character **characterlist = ONgGameState->PresentCharacterList; //pointer to array of Character pointers
|
---|
22 | int total_characters = ONgGameState->PresentCharacterListCount; //Max number of characters
|
---|
23 | for(i = 0; i < total_characters; i++) {
|
---|
24 | if (characterlist[i] != 0) //anti Blam!
|
---|
25 | if (!strcmp(characterlist[i]->Name, input)) { //checks for the same name
|
---|
26 | return characterlist[i]->Number;
|
---|
27 | }
|
---|
28 | }
|
---|
29 | return -1; //not found :(
|
---|
30 | }
|
---|
31 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.