]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added no_align option to Item_Create.
authorLyberta <lyberta@lyberta.net>
Sat, 25 Nov 2017 02:06:45 +0000 (05:06 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 25 Nov 2017 02:06:45 +0000 (05:06 +0300)
qcsrc/common/mutators/mutator/random_items/sv_random_items.qc
qcsrc/server/items.qc
qcsrc/server/items.qh

index 43ff0a5e33026b2033043ed420733fbfaa52283e..b4a15fb801f4d827437040ad5b9e9b56c671fd33 100644 (file)
@@ -222,7 +222,7 @@ entity RandomItems_ReplaceMapItem(entity item)
        entity new_item;
        if (!expr_evaluate(autocvar_g_overkill))
        {
-               new_item = Item_Create(strzone(new_classname), item.origin);
+               new_item = Item_Create(strzone(new_classname), item.origin, true);
                random_items_is_spawning = false;
                if (new_item == NULL)
                {
index 0bbf499b5883b7798ddf1bac303caae7cc2a4d64..29a8609bc628530049fb3b11677599529d320b5b 100644 (file)
 /// this item is on the ground.
 .bool m_isexpiring;
 
-entity Item_Create(string class_name, vector position)
+entity Item_Create(string class_name, vector position, bool no_align)
 {
        entity item = spawn();
        item.classname = class_name;
        item.spawnfunc_checked = true;
        setorigin(item, position);
+       item.noalign = no_align;
        Item_Initialize(item, class_name);
        if (wasfreed(item))
        {
index a1e3a313108e93f217df8db885a9d06a1d021f68..af55eebd4d60e42c34505515b42d3fd85dd1b689 100644 (file)
@@ -7,8 +7,10 @@
 /// \brief Creates a new item.
 /// \param[in] class_name Class name of the item.
 /// \param[in] position Position of the item.
+/// \param[in] no_align True if item should be placed directly at specified
+/// position, false to let it drop to the ground.
 /// \return Item on success, NULL otherwise.
-entity Item_Create(string class_name, vector position);
+entity Item_Create(string class_name, vector position, bool no_align);
 
 /// \brief Initializes the item according to classname.
 /// \param[in,out] item Item to initialize.