Loading

Paste #pdzyemlyo

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

Version history

Revision # Author Created at
pnchdlx6n Anonymous 25 Apr 2016, 19:27:29 UTC Diff
pudxpqhgr Anonymous 25 Apr 2016, 19:17:17 UTC Diff
p7c0lr2u8 Anonymous 25 Apr 2016, 16:16:15 UTC Diff

Comments