Loading

Paste #p7c0lr2u8

  1. /* Find out which parameters are editable */
  2. _game_mode != GM_NORMAL // not in a game, and thus, editable
  3. _game_mode == GM_NORMAL // in a game, orange, red and green have parameters, check if they're AI or GS
  4.  
  5. this->slot != OWNER_DEITY // it's an AI slot, check if it's orange, red or green
  6. this->slot == OWNER_DEITY // it's a GS slot, check IsDead
  7.  
  8. /* GS Check */
  9. Game::GetInstance()->IsDead() = true  // GS is red and dead, and thus, editable
  10. Game::GetInstance()->IsDead() = false // GS is green and not dead, check flag
  11.  
  12. /* AI Check */
  13. Company::IsValidAiID(this->slot) = true  // AI started this company, check if it's red or green
  14. Company::IsValidAiID(this->slot) = false // No AI started this company, or a human started it, this slot is orange or silver, but assume it as being orange, and thus, editable
  15.  
  16. Company::Get(this->slot)->ai_instance->IsDead() = true  // AI is red and dead, and thus, editable
  17. Company::Get(this->slot)->ai_instance->IsDead() = false // AI is green and not dead, check flag
  18.  
  19. /* Flag Check */
  20. (config_item.flags & SCRIPTCONFIG_INGAME) != 0 // flag is set, and thus, editable
  21. (config_item.flags & SCRIPTCONFIG_INGAME) == 0 // flag is not set, and thus, not editable

Comments