source: Daodan/src/Daodan_Character.c@ 983

Last change on this file since 983 was 739, checked in by iritscen, 12 years ago

Fixed significant misspellings.

File size: 1.4 KB
Line 
1#include <stdlib.h>
2#include "Daodan_Character.h"
3#include "Oni_Character.h"
4#include "Oni.h"
5
6int 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
19uint32_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.