Browse Source

hellfire: Make DropHalfPlayersGold bin exact.

pull/876/head
Sergey Semushin 7 years ago committed by Anders Jenbo
parent
commit
c067846937
  1. 4
      Source/items.cpp
  2. 4
      Source/items.h
  3. 14
      Source/player.cpp

4
Source/items.cpp

@ -20,6 +20,10 @@ int gnNumGetRecords;
/* data */
#ifdef HELLFIRE
int MaxGold = GOLD_MAX_LIMIT;
#endif
BYTE ItemCAnimTbl[169] = {
20, 16, 16, 16, 4, 4, 4, 12, 12, 12,
12, 12, 12, 12, 12, 21, 21, 25, 12, 28,

4
Source/items.h

@ -137,6 +137,10 @@ void PutItemRecord(int nSeed, WORD wCI, int nIndex);
/* data */
#ifdef HELLFIRE
extern int MaxGold;
#endif
extern BYTE ItemCAnimTbl[169];
extern char *ItemDropNames[35];
extern BYTE ItemAnimLs[35];

14
Source/player.cpp

@ -1962,7 +1962,12 @@ void DropHalfPlayersGold(int pnum)
hGold = plr[pnum]._pGold >> 1;
for (i = 0; i < MAXBELTITEMS && hGold > 0; i++) {
if (plr[pnum].SpdList[i]._itype == ITYPE_GOLD && plr[pnum].SpdList[i]._ivalue != GOLD_MAX_LIMIT) {
if (plr[pnum].SpdList[i]._itype == ITYPE_GOLD &&
#ifndef HELLFIRE
plr[pnum].SpdList[i]._ivalue != GOLD_MAX_LIMIT) {
#else
plr[pnum].SpdList[i]._ivalue != MaxGold) {
#endif
if (hGold < plr[pnum].SpdList[i]._ivalue) {
plr[pnum].SpdList[i]._ivalue -= hGold;
SetSpdbarGoldCurs(pnum, i);
@ -2012,7 +2017,12 @@ void DropHalfPlayersGold(int pnum)
drawpanflag = 255;
if (hGold > 0) {
for (i = 0; i < plr[pnum]._pNumInv && hGold > 0; i++) {
if (plr[pnum].InvList[i]._itype == ITYPE_GOLD && plr[pnum].InvList[i]._ivalue != GOLD_MAX_LIMIT) {
if (plr[pnum].InvList[i]._itype == ITYPE_GOLD &&
#ifndef HELLFIRE
plr[pnum].InvList[i]._ivalue != GOLD_MAX_LIMIT) {
#else
plr[pnum].InvList[i]._ivalue != MaxGold) {
#endif
if (hGold < plr[pnum].InvList[i]._ivalue) {
plr[pnum].InvList[i]._ivalue -= hGold;
SetGoldCurs(pnum, i);

Loading…
Cancel
Save