source: Daodan/src/Daodan_Character.c@ 845

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

Fixed significant misspellings.

File size: 1.4 KB
RevLine 
[427]1#include <stdlib.h>
[428]2#include "Daodan_Character.h"
[427]3#include "Oni_Character.h"
[446]4#include "Oni.h"
[427]5
[428]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;
[739]13 else if (!strcmp(team_string, "RogueKonoko")) return team_roguekonoko;
[428]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.....
[427]17}
18
[446]19uint32_t DDrGetCharacterIndexFromName(char* input) {
20 int i;
[677]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++) {
[446]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 }
[692]29 return -1; //not found :(
[446]30}
[692]31
Note: See TracBrowser for help on using the repository browser.