Bug 2749 - Dead code
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: PC All
: P2 trivial
Assignee: Tim Angus
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2006-06-16 09:21 EDT by Martin Doucha
Modified: 2006-06-18 12:35:57 EDT
1 user (show)

See Also:


Attachments
Dead code patch (1.11 KB, patch)
2006-06-16 09:23 EDT, Martin Doucha

Description Martin Doucha 2006-06-16 09:21:05 EDT
The EV_NOAMMO handler in game/g_active.c (starting line 867) is dead code since it handles only grenades and WP_GRENADE is never selected to ent->s.weapon (except a little "monster hack" but it's reset immediately). WP_GRENADE is not a valid inventory item either, grenade has special UP_GRENADE item instead.

A quick way to check that code: Buy a grenade, switch to blaster and throw grenade. If that code wasn't dead, you'd switch to main weapon automatically after throwing grenade.
Comment 1 Martin Doucha 2006-06-16 09:23:22 EDT
Created attachment 938 [details]
Dead code patch

This patch removes dead grenade code leaving empty EV_NOAMMO handler for further use.