Extend /pair command to work with character names as well as IDs (#562)
This commit is contained in:
		
							parent
							
								
									9e0a964af8
								
							
						
					
					
						commit
						65f812cf73
					
				@ -4028,12 +4028,30 @@ void Courtroom::on_ooc_return_pressed()
 | 
			
		||||
            "CLIENT", tr("You are no longer paired with anyone."), "1");
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
      int whom = 0;
 | 
			
		||||
      bool matched = false;
 | 
			
		||||
      for (char_type chara : char_list) {
 | 
			
		||||
        if (chara.name.toLower() == ooc_message.toLower()) {
 | 
			
		||||
          matched = true;
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
        whom++;
 | 
			
		||||
      }
 | 
			
		||||
      if (matched) {
 | 
			
		||||
        other_charid = whom;
 | 
			
		||||
        QString msg = tr("You will now pair up with %1 if they also choose "
 | 
			
		||||
                         "your character in return.")
 | 
			
		||||
                          .arg(char_list.at(whom).name);
 | 
			
		||||
        append_server_chatmessage("CLIENT", msg, "1");
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
        append_server_chatmessage("CLIENT",
 | 
			
		||||
                                  tr("Are you sure you typed that well? The char "
 | 
			
		||||
                                   "ID could not be recognised."),
 | 
			
		||||
                                     "ID/name could not be recognised."),
 | 
			
		||||
                                  "1");
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  else if (ooc_message.startsWith("/offset")) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user