ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Character.c
(Generate patch)

Comparing Daodan/src/Daodan_Character.c (file contents):
Revision 427 by gumby, Thu Jul 16 06:10:18 2009 UTC vs.
Revision 428 by rossy, Thu Jul 16 06:37:58 2009 UTC

# Line 1 | Line 1
1   #include <stdlib.h>
2 + #include "Daodan_Character.h"
3   #include "Oni_Character.h"
4  
5 < int DDr_TeamToTeamID(const char* team_string) { //Already something like this in the engine, but I'm reimplementing it...
6 <        if (!strcmp(team_string, "Konoko")) return 0;
7 <        if (!strcmp(team_string, "TCTF")) return 1;
8 <        if (!strcmp(team_string, "Syndicate")) return 2;
9 <        if (!strcmp(team_string, "Neutral")) return 3;
10 <        if (!strcmp(team_string, "SecurityGuard")) return 4;
11 <        if (!strcmp(team_string, "RougeKonoko")) return 5;
12 <        if (!strcmp(team_string, "Switzerland")) return 6;
13 <        if (!strcmp(team_string, "SyndicateAccessory")) return 7;
14 <        return 3; //if you enter a bad teamname, return Neutral.....
5 > int DDr_TeamToTeamID(const char* team_string) //Already something like this in the engine, but I'm reimplementing it...
6 > {
7 >        if (!strcmp(team_string, "Konoko"))                  return team_konoko;
8 >        else if (!strcmp(team_string, "TCTF"))               return team_tctf;
9 >        else if (!strcmp(team_string, "Syndicate"))          return team_syndicate;
10 >        else if (!strcmp(team_string, "Neutral"))            return team_neutral;
11 >        else if (!strcmp(team_string, "SecurityGuard"))      return team_securityguard;
12 >        else if (!strcmp(team_string, "RougeKonoko"))        return team_rougekonoko;
13 >        else if (!strcmp(team_string, "Switzerland"))        return team_switzerland;
14 >        else if (!strcmp(team_string, "SyndicateAccessory")) return team_syndicateaccessory;
15 >        return team_neutral; //if you enter a bad teamname, return Neutral.....
16   }
17  
18 < int CHARTest() {
18 > void CHARTest()
19 > {
20          CharacterObject TestCHAR;
21          memset(&TestCHAR, 0, sizeof(CharacterObject));
22 <        TestCHAR.Header.Type = "CHAR";
23 <        TestCHAR.OSD.Name = "Gumby";
24 <        TestCHAR.OSD.Class = "muro_generic";
25 <        TestCHAR.OSD.TeamID = DDr_TeamToTeamID("Syndicate");
26 <        ONrGameState_NewCharacter(&TestCHAR, 0);
27 <        return 0;
28 < }
22 >        
23 >        memcpy(TestCHAR.Header.Type, "CHAR", 5);
24 >        memcpy(TestCHAR.OSD.Name, "Gumby", 6);
25 >        memcpy(TestCHAR.OSD.Class, "muro_generic", 13);
26 >        TestCHAR.OSD.TeamID = team_syndicate;
27 >        
28 >        ONrGameState_NewCharacter(&TestCHAR, NULL);
29 > }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)