Loading

Paste #pudxpqhgr

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

Version history

Revision # Author Created at
p7c0lr2u8 Anonymous 25 Apr 2016, 16:16:15 UTC Diff

Comments