UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Closed Bug report #2346 cl_hud.c uncompileable (with patch)
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "Not determined".
Issue basics
  • Type of issue
    Bug report
  • Category
    General
  • Targetted for
    Not determined
  • Status
    Closed
  • Priority
    3. Normal
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
  • Estimated time
    Not estimated
Issue details
  • Resolution
    Not determined
  • Reproducability
    Not determined
  • Severity
    Not determined
  • Complexity
    Not determined
  • Platform
    Not determined
  • Architecture
    Not determined
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
[http://sourceforge.net/p/ufoai/bugs/2346 Item 2346] imported from sourceforge.net tracker on 2013-01-28 19:30:37

src/client/battlescape/cl_hud.c is uncompileable due to two problems: the file is compiled as a C file and uses argument overloading; a function is used before it has been declared. The following patch (svn diff created it) fixes both problems.

Index: src/client/battlescape/cl_hud.c
===================================================================
--- src/client/battlescape/cl_hud.c (revision 28433)
+++ src/client/battlescape/cl_hud.c (working copy)
@@ -121,6 +121,27 @@
}

/**
+ * @brief returns the weapon the actor's left hand is touching. In case the actor
+ * holds a two handed weapon in his right hand, this weapon is returned here.
+ * This function only returns @c NULL if no two handed weapon is in the right hand
+ * and the left hand is empty.
+ */
+static invList_t* HUD_GetLeftHandWeapon (le_t *actor, int *container)
+{
+ invList_t *weapon = LEFT(actor);
+
+ if (!weapon || !weapon->item.m) {
+ weapon = RIGHT(actor);
+ if (!weapon->item.t->holdTwoHanded)
+ weapon = NULL;
+ else if (container != NULL)
+ *container = csi.idRight;
+ }
+
+ return weapon;
+}
+
+/**
* @brief Updates the global character cvars for battlescape.
* @note This is only called when we are in battlescape rendering mode
* It's assumed that every living actor - @c le_t - has a character assigned, too
@@ -1297,27 +1318,7 @@
return 100 * (hitchance * (0.125) * n);
}

-/**
- * @brief returns the weapon the actor's left hand is touching. In case the actor
- * holds a two handed weapon in his right hand, this weapon is returned here.
- * This function only returns @c NULL if no two handed weapon is in the right hand
- * and the left hand is empty.
- */
-static invList_t* HUD_GetLeftHandWeapon (le_t *actor, int *container)
-{
- invList_t *weapon = LEFT(actor);

- if (!weapon || !weapon->item.m) {
- weapon = RIGHT(actor);
- if (!weapon->item.t->holdTwoHanded)
- weapon = NULL;
- else if (container != NULL)
- *container = csi.idRight;
- }
-
- return weapon;
-}
-
/**
* @brief Updates console vars for an actor.
*
@@ -1653,6 +1654,7 @@
MSG_Write_PA(PA_STATE, selActor->entnum, state);
}

+
/**
* @brief Reload left weapon.
*/

===== Comments Ported from Sourceforge =====

====== frederikhertzum (2010-02-06 02:04:09) ======

svn revision was 28433. 28432 only had the problem with the undeclared function.
====== frederikhertzum (2010-02-06 02:10:31) ======

Forget that last comment -- development was going faster than I expected. The problem is slightly older.
====== tlh2000 (2010-02-06 08:40:38) ======

thanks for the patch - was my fault, i forgot to commit a file.
====== tlh2000 (2010-02-06 08:41:13) ======

btw. we are always searching contributors ;)
Steps to reproduce this issue
Nothing entered.
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif