From 871e4ea69c0c22ffce766bb4ce4f6ffb79f2f849 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 28 Jul 2003 11:02:26 +0000 Subject: [PATCH] fix setattachment (it was setting tag_index to i, should have been i + 1), also added some developer warnings if it fails git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3343 d7cf8633-e32d-0410-b094-e92efae38249 --- pr_cmds.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pr_cmds.c b/pr_cmds.c index 37f7222a..1eeefc2d 100644 --- a/pr_cmds.c +++ b/pr_cmds.c @@ -2980,8 +2980,12 @@ void PF_setattachment (void) if (model->alias.aliasnum_tags) for (i = 0;i < model->alias.aliasnum_tags;i++) if (!strcmp(tagname, model->alias.aliasdata_tags[i].name)) - v->_float = i; + v->_float = i + 1; + if (v->_float == 0) + Con_DPrintf("setattachment(edict %i, edict %i, string \"%s\"): tried to find tag named \"%s\" on entity %i (model \"%s\") but could not find it\n", NUM_FOR_EDICT(e), NUM_FOR_EDICT(tagentity), tagname, tagname, NUM_FOR_EDICT(tagentity), model->name); } + else + Con_DPrintf("setattachment(edict %i, edict %i, string \"%s\"): tried to find tag named \"%s\" on entity %i but it has no model\n", NUM_FOR_EDICT(e), NUM_FOR_EDICT(tagentity), tagname, tagname, NUM_FOR_EDICT(tagentity)); } } -- 2.39.2