INNER CODE UNIT · C

unitType

acoto87/war1 · src/war_ai.c:170

    WarUnitType unitType = command->request.unitType;
    if (wu_isDudeUnitType(unitType))
    {
        if (wai_hasUnresolvedTrainRequest(context, command))
        {
            return false;
        }

        const WarUnitStats* stats = wu_getUnitStats(unitType);
        if (!we_enoughPlayerResources(context, aiPlayer, stats->goldCost, stats->woodCost))
        {
            // there is not enough resources to create the unit
            return false;
        }

        // check if there is enough food
        if (!we_enoughFarmFood(context, aiPlayer))
        {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…