Code: Show/Hide int countnum=0;
_listnode *parse1 = playerlist->head; { Player *p = parse1->item; if (p->ship != SHIP_Spectator) { pilots[countnum].PlayerCall=String(p->name); countnum++; } parse1 = parse1->next; } |
| Quote: |
| Compiling...
spawn.cpp d:\bots\ds soccer\mervbot\src\soccer\spawn.cpp(69) : error C2440: 'initializing' : cannot convert from 'class _listnode<struct Player> *' to 'class _listnode *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast d:\bots\ds soccer\mervbot\src\soccer\spawn.cpp(72) : error C2440: 'initializing' : cannot convert from ' *' to 'struct Player *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast d:\bots\ds soccer\mervbot\src\soccer\spawn.cpp(76) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class String' (or there is no acceptable conversion) d:\bots\ds soccer\mervbot\src\soccer\spawn.cpp(80) : error C2440: '=' : cannot convert from 'class _listnode<AnonymousStruct> *' to 'class _listnode *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast command.cpp Error executing cl.exe. soccer.dll - 4 error(s), 0 warning(s) |
| Quote: |
| _listnode *parse1 = playerlist->head; |
| Quote: |
| pilots[countnum].PlayerCall=String(p->name); |
Code: Show/Hide String s = "*setfreq ";
s += p->ship; |
| The Arctica wrote: |
| _listnode *parse1 = playerlist->head; |
| The Arctica wrote: |
| pilots[countnum].PlayerCall=String(p->name); |
Code: Show/Hide int countnum=0; _listnode <Player> *parse1 = playerlist->head; while(parse1 != NULL) { Player *p = parse1->item; if (p->ship != SHIP_Spectator) { //pilots[countnum].PlayerCall=String(p->name); //if PlayerCall is of the type String then you can just do PlayerCall= p->name and it work. Otherwise, if its a char[20] then you use strncpy or strcpy to copy in the player's name. Hopefully there is some control over how many piolets are in the game or you might have a buffer overrun on that pilots array. Dont overindex it! countnum++; } parse1 = parse1->next; } |
Code: Show/Hide Compiling...
spawn.cpp command.cpp Linking... Creating library Debug/soccer.lib and object Debug/soccer.exp soccer.dll - 0 error(s), 0 warning(s) |