Fixed function CursorByIdent in src/video/cursor.cpp
This function does not correct search for cursor if there are more races
This commit is contained in:
parent
77ff728df5
commit
170df2525d
1 changed files with 2 additions and 4 deletions
|
@ -135,12 +135,10 @@ CCursor *CursorByIdent(const std::string &ident)
|
|||
std::vector<CCursor>::iterator i;
|
||||
|
||||
for (i = AllCursors.begin(); i != AllCursors.end(); ++i) {
|
||||
if ((*i).Ident != ident) {
|
||||
if ((*i).Ident != ident || ! (*i).G->IsLoaded())
|
||||
continue;
|
||||
}
|
||||
if ((*i).Race.empty() || (*i).G->IsLoaded()) {
|
||||
if ((*i).Race.empty() || ! ThisPlayer || (*i).Race == PlayerRaces.Name[ThisPlayer->Race])
|
||||
return &(*i);
|
||||
}
|
||||
}
|
||||
DebugPrint("Cursor `%s' not found, please check your code.\n" _C_ ident.c_str());
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue