From c1f5659977ad43ae657ce76fc53f0becabe34701 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 16 Aug 2002 21:52:37 +0000 Subject: [PATCH] bi_inputline.c: add InputLine_SetUserData pr_resolve.c: report the correct missing symbol (self instead of time) --- libs/gamecode/builtins/bi_inputline.c | 12 ++++++++++++ libs/gamecode/engine/pr_resolve.c | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libs/gamecode/builtins/bi_inputline.c b/libs/gamecode/builtins/bi_inputline.c index 728c61d85..0692b357c 100644 --- a/libs/gamecode/builtins/bi_inputline.c +++ b/libs/gamecode/builtins/bi_inputline.c @@ -104,6 +104,16 @@ bi_InputLine_Create (progs_t *pr) R_INT (pr) = handle - pr->pr_globals; } +static void +bi_InputLine_SetUserData (progs_t *pr) +{ + inputline_t *line = get_inputline (pr, P_INT (pr, 0), + "InputLine_SetWidth"); + pr_type_t *data = P_POINTER (pr, 1); + + line->user_data = data; +} + static void bi_InputLine_SetWidth (progs_t *pr) { @@ -233,6 +243,8 @@ InputLine_Progs_Init (progs_t *pr) PR_Resources_Register (pr, "InputLine", res, bi_il_clear); PR_AddBuiltin (pr, "InputLine_Create", bi_InputLine_Create, -1); + PR_AddBuiltin (pr, "InputLine_SetUserData", + bi_InputLine_SetUserData, -1); PR_AddBuiltin (pr, "InputLine_SetWidth", bi_InputLine_SetWidth, -1); PR_AddBuiltin (pr, "InputLine_SetText", bi_InputLine_SetText, -1); PR_AddBuiltin (pr, "InputLine_GetText", bi_InputLine_GetText, -1); diff --git a/libs/gamecode/engine/pr_resolve.c b/libs/gamecode/engine/pr_resolve.c index 7c5d6b0bc..a24e76bf2 100644 --- a/libs/gamecode/engine/pr_resolve.c +++ b/libs/gamecode/engine/pr_resolve.c @@ -168,8 +168,10 @@ PR_ResolveGlobals (progs_t *pr) goto error; pr->globals.time = &G_FLOAT (pr, def->ofs); if (!(def = PR_FindGlobal (pr, ".self"))) - if (!(def = PR_FindGlobal (pr, "self"))) + if (!(def = PR_FindGlobal (pr, "self"))) { + sym = "self"; goto error; + } pr->globals.self = &G_INT (pr, def->ofs); if ((pr->fields.nextthink = ED_GetFieldIndex (pr, sym = "nextthink")) == -1) goto error;