]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Add an entity parameter for CSQC_InputEvent
authorMario <mario@smbclan.net>
Thu, 28 May 2020 12:38:53 +0000 (22:38 +1000)
committerMario <mario@smbclan.net>
Thu, 28 May 2020 12:38:53 +0000 (22:38 +1000)
csprogs.c

index 68e7b3c066ed2e43fc08dab563d984fc973eeb04..13c27ec3992d9d3ebbadd531b8047b9daf77c7b2 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -456,6 +456,8 @@ qboolean CL_VM_InputEvent (int eventtype, float x, float y)
                        PRVM_G_FLOAT(OFS_PARM0) = eventtype;
                        PRVM_G_FLOAT(OFS_PARM1) = x; // key or x
                        PRVM_G_FLOAT(OFS_PARM2) = y; // ascii or y
+                       // optional entity parameter for self (EXT_ENTITYPARAM)
+                       PRVM_G_INT(OFS_PARM3) = cl.csqc_server2csqcentitynumber[cl.playerentity];
                        prog->ExecuteProgram(prog, PRVM_clientfunction(CSQC_InputEvent), "QC function CSQC_InputEvent is missing");
                        r = CSQC_RETURNVAL != 0;
                }