1
0

add select command to support checking for accepted dialogs

This commit is contained in:
Emagi 2025-01-04 16:10:38 -05:00
parent 1cc7d22a44
commit a820439430

View File

@ -11575,7 +11575,11 @@ void Commands::Command_Weather(Client* client, Seperator* sep)
void Commands::Command_Select(Client* client, Seperator* sep) { void Commands::Command_Select(Client* client, Seperator* sep) {
if (sep && sep->arg[1]) { if (sep && sep->arg[1]) {
Spawn* spawn = client->GetPlayer()->GetTarget(); Spawn* spawn = client->GetPlayer()->GetTarget();
if (spawn && strlen(sep->arg[1]) > 0) int32 spawn_id = client->dialog_manager.getAcceptValue("select");
if(spawn && spawn_id == spawn->GetID()) {
client->GetCurrentZone()->CallSpawnScript(spawn, SPAWN_SCRIPT_CASTED_ON, client->GetPlayer(), sep->argplus[0]);
}
else if (spawn && strlen(sep->arg[1]) > 0)
client->GetCurrentZone()->CallSpawnScript(spawn, SPAWN_SCRIPT_CUSTOM, client->GetPlayer(), sep->arg[1]); client->GetCurrentZone()->CallSpawnScript(spawn, SPAWN_SCRIPT_CUSTOM, client->GetPlayer(), sep->arg[1]);
} }
} }