[Fix] Display '0' properly if you sell al your ammo.
This commit is contained in:
parent
fc5535f0f8
commit
89f690eda0
20
src/player.c
20
src/player.c
@ -416,14 +416,28 @@ void player_render(void) {
|
|||||||
} else {
|
} else {
|
||||||
f = &gl_defFont;
|
f = &gl_defFont;
|
||||||
if(player->ammo == NULL) {
|
if(player->ammo == NULL) {
|
||||||
|
if(outfit_isLauncher(player->secondary->outfit)) {
|
||||||
|
// Out of ammo.
|
||||||
|
i = gl_printWidth(f, "%s", player->secondary->outfit->u.lau.ammo);
|
||||||
|
if(i > (int)gui.weapon.w)
|
||||||
|
// Font is too big.
|
||||||
|
f = &gl_smallFont;
|
||||||
|
gl_printMid(f, (int)gui.weapon.w,
|
||||||
|
gui.weapon.x, gui.weapon.y - 5,
|
||||||
|
&cConsole, "%s", player->secondary->outfit->u.lau.ammo);
|
||||||
|
gl_printMid(&gl_smallFont, (int)gui.weapon.w,
|
||||||
|
gui.weapon.x, gui.weapon.y - 10 - gl_defFont.h,
|
||||||
|
NULL, "0");
|
||||||
|
} else {
|
||||||
|
// Not a launcher.
|
||||||
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
||||||
if(i > (int)gui.weapon.w)
|
if(i > (int)gui.weapon.w)
|
||||||
// Font is too big.
|
// Font is too big.
|
||||||
f = &gl_smallFont;
|
f = &gl_smallFont;
|
||||||
|
gl_printMid(f, (int) gui.weapon.w,
|
||||||
gl_printMid(f, (int)gui.weapon.w, gui.weapon.x,
|
gui.weapon.x, gui.weapon.y - (gui.weapon.h - f->h)/2.,
|
||||||
gui.weapon.y - (gui.weapon.h - f->h)/2.,
|
|
||||||
&cConsole, "%s", player->secondary->outfit->name);
|
&cConsole, "%s", player->secondary->outfit->name);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Use the ammunitions name.
|
// Use the ammunitions name.
|
||||||
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
||||||
|
Loading…
Reference in New Issue
Block a user