From ea6aa9220c7a3b6caee3826bb158193aaa8046ac Mon Sep 17 00:00:00 2001 From: Lyberta Date: Wed, 25 Oct 2017 00:08:04 +0300 Subject: [PATCH] Better item creation code. --- qcsrc/server/items.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/items.qc b/qcsrc/server/items.qc index 1265f71c5..0bbf499b5 100644 --- a/qcsrc/server/items.qc +++ b/qcsrc/server/items.qc @@ -18,12 +18,12 @@ entity Item_Create(string class_name, vector position) entity item = spawn(); item.classname = class_name; item.spawnfunc_checked = true; + setorigin(item, position); Item_Initialize(item, class_name); if (wasfreed(item)) { return NULL; } - setorigin(item, position); return item; } @@ -59,6 +59,7 @@ bool Item_InitializeLoot(entity item, string class_name, vector position, item.classname = class_name; Item_SetLoot(item, true); item.noalign = true; + setorigin(item, position); item.pickup_anyway = true; item.spawnfunc_checked = true; Item_Initialize(item, class_name); @@ -67,7 +68,6 @@ bool Item_InitializeLoot(entity item, string class_name, vector position, return false; } item.gravity = 1; - setorigin(item, position); item.velocity = vel; SUB_SetFade(item, time + time_to_live, 1); return true; -- 2.39.2