From c32e446060df3ccfcbec6fa49ab1146ae2ba7076 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 3 Jul 2005 07:07:34 +0000 Subject: [PATCH] don't print PRVM_NAME in each dprint call, it looks terrible (prints multiple times per line because of multiple dprint calls without \n) fix fatal bug in findchain and findchainfloat which were using FindFieldOffset (which returns a byte array index) to get an offset to feed to PRVM_E_INT (which takes an integer array index) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5482 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_cmds.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/prvm_cmds.c b/prvm_cmds.c index e06c23f7..388ea5b2 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -564,7 +564,11 @@ void VM_dprint (void) if (developer.integer) { VM_VarString(0, string, sizeof(string)); +#if 1 + Con_Printf("%s", string); +#else Con_Printf("%s: %s", PRVM_NAME, string); +#endif } } @@ -849,7 +853,7 @@ void VM_findchain (void) if(!prog->flag & PRVM_FE_CHAIN) PRVM_ERROR("VM_findchain: %s doesnt have a chain field !\n", PRVM_NAME); - chain_of = PRVM_ED_FindFieldOffset ("chain"); + chain_of = PRVM_ED_FindField("chain")->ofs; chain = prog->edicts; @@ -903,7 +907,7 @@ void VM_findchainfloat (void) if(!prog->flag & PRVM_FE_CHAIN) PRVM_ERROR("VM_findchainfloat: %s doesnt have a chain field !\n", PRVM_NAME); - chain_of = PRVM_ED_FindFieldOffset ("chain"); + chain_of = PRVM_ED_FindField("chain")->ofs; chain = (prvm_edict_t *)prog->edicts; -- 2.39.2