Skip to content

Commit

Permalink
impersonate user bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed May 24, 2024
1 parent 13d1405 commit dd558d8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions klite.embd
Original file line number Diff line number Diff line change
Expand Up @@ -10236,12 +10236,7 @@ Current version: 141

//randomize opponent if there is more than one
let hasMulti = false;
if(is_impersonate_user)
{
is_impersonate_user = false;
co = localsettings.chatname;
}
else if(co.includes("||$||"))
if(!is_impersonate_user && co.includes("||$||"))
{
let coarr = co.split("||$||");
coarr = coarr.filter(x=>(x&&x!=""));
Expand Down Expand Up @@ -10283,9 +10278,16 @@ Current version: 141
if(trimmed!=""){ co = trimmed; }
}

let original_co = co;
if(is_impersonate_user) //replace opponent with ourselves if needed
{
is_impersonate_user = false;
co = localsettings.chatname;
}

if (localsettings.chat_context_mod && current_anote.length == 0 && current_memory.length == 0 && current_wi.length == 0) {
if (gametext_arr.length > 0 && gametext_arr[0].startsWith("\n" + me + ": ")) {
let injected = "[The following is an interesting chat message log between " + me + " and " + co + ".]\n\n" + localsettings.chatname + ": Hi.\n" + co + ": Hello.";
let injected = "[The following is an interesting chat message log between " + me + " and " + original_co + ".]\n\n" + localsettings.chatname + ": Hi.\n" + original_co + ": Hello.";
if(co=="")
{
injected = "[The following is an interesting chat message log between " + me + " and someone else.]\n\n" + localsettings.chatname + ": Hi.";
Expand Down

0 comments on commit dd558d8

Please sign in to comment.