src/ai/api/ai_company.cpp
branchnoai
changeset 9701 d1ac22c62f64
parent 9696 4384ed3de1f0
child 9723 eee46cb39750
equal deleted inserted replaced
9700:e442ce398e83 9701:d1ac22c62f64
    10 #include "../../variables.h"
    10 #include "../../variables.h"
    11 #include "table/strings.h"
    11 #include "table/strings.h"
    12 
    12 
    13 AICompany::CompanyIndex AICompany::ResolveCompanyIndex(AICompany::CompanyIndex company)
    13 AICompany::CompanyIndex AICompany::ResolveCompanyIndex(AICompany::CompanyIndex company)
    14 {
    14 {
    15 	if (company == MY_COMPANY) return (CompanyIndex)_current_player;
    15 	if (company == MY_COMPANY) return (CompanyIndex)((byte)_current_player);
    16 
    16 
    17 	return (IsValidPlayer((PlayerID)company) && GetPlayer((PlayerID)company)->is_active) ? company : INVALID_COMPANY;
    17 	return (IsValidPlayer((PlayerID)company) && GetPlayer((PlayerID)company)->is_active) ? company : INVALID_COMPANY;
    18 }
    18 }
    19 
    19 
    20 bool AICompany::SetCompanyName(const char *name)
    20 bool AICompany::SetCompanyName(const char *name)