.touch fixes.

This commit is contained in:
Marco Cawthorne 2022-04-03 14:08:30 -07:00
parent 02287fee0b
commit f5e36f0cb8
Signed by: eukara
GPG key ID: C196CD8BA993248A
2 changed files with 14 additions and 14 deletions

View file

@ -26,7 +26,7 @@ A single ammo_egonclip will provide 25, er, gas.
class ammo_egonclip:item_ammo class ammo_egonclip:item_ammo
{ {
void(void) ammo_egonclip; void(void) ammo_egonclip;
virtual void(void) touch; virtual void(entity) Touch;
}; };
void void
@ -37,7 +37,7 @@ ammo_egonclip::ammo_egonclip(void)
item_ammo::item_ammo(); item_ammo::item_ammo();
} }
void void
ammo_egonclip::touch(void) ammo_egonclip::Touch(entity eToucher)
{ {
if not (other.flags & FL_CLIENT) { if not (other.flags & FL_CLIENT) {
return; return;
@ -46,7 +46,7 @@ ammo_egonclip::touch(void)
player pl = (player)other; player pl = (player)other;
if (pl.ammo_gas < MAX_A_GAS) { if (pl.ammo_gas < MAX_A_GAS) {
pl.ammo_gas = bound(0, pl.ammo_gas + 25, MAX_A_GAS); pl.ammo_gas = bound(0, pl.ammo_gas + 25, MAX_A_GAS);
item_ammo::touch(); item_ammo::Touch(eToucher);
Sound_Play(other, CHAN_ITEM, "ammo_gas.pickup"); Sound_Play(other, CHAN_ITEM, "ammo_gas.pickup");
} }
} }
@ -63,7 +63,7 @@ A single ammo_th_ap9 will provide 40 bullets.
class ammo_th_ap9:item_ammo class ammo_th_ap9:item_ammo
{ {
void(void) ammo_th_ap9; void(void) ammo_th_ap9;
virtual void(void) touch; virtual void(entity) Touch;
}; };
void void
@ -73,7 +73,7 @@ ammo_th_ap9::ammo_th_ap9(void)
item_ammo::item_ammo(); item_ammo::item_ammo();
} }
void void
ammo_th_ap9::touch(void) ammo_th_ap9::Touch(entity eToucher)
{ {
if not (other.flags & FL_CLIENT) { if not (other.flags & FL_CLIENT) {
return; return;
@ -82,7 +82,7 @@ ammo_th_ap9::touch(void)
player pl = (player)other; player pl = (player)other;
if (pl.ammo_ap9 < MAX_A_AP9) { if (pl.ammo_ap9 < MAX_A_AP9) {
pl.ammo_ap9 = bound(0, pl.ammo_ap9 + 40, MAX_A_AP9); pl.ammo_ap9 = bound(0, pl.ammo_ap9 + 40, MAX_A_AP9);
item_ammo::touch(); item_ammo::Touch(eToucher);
} }
} }
} }
@ -98,7 +98,7 @@ A single ammo_th_taurus will provide 10 bullets.
class ammo_th_taurus:item_ammo class ammo_th_taurus:item_ammo
{ {
void(void) ammo_th_taurus; void(void) ammo_th_taurus;
virtual void(void) touch; virtual void(entity) Touch;
}; };
void void
@ -108,7 +108,7 @@ ammo_th_taurus::ammo_th_taurus(void)
item_ammo::item_ammo(); item_ammo::item_ammo();
} }
void void
ammo_th_taurus::touch(void) ammo_th_taurus::Touch(entity eToucher)
{ {
if not (other.flags & FL_CLIENT) { if not (other.flags & FL_CLIENT) {
return; return;
@ -117,7 +117,7 @@ ammo_th_taurus::touch(void)
player pl = (player)other; player pl = (player)other;
if (pl.ammo_taurus < MAX_A_TAURUS) { if (pl.ammo_taurus < MAX_A_TAURUS) {
pl.ammo_taurus = bound(0, pl.ammo_taurus + 10, MAX_A_TAURUS); pl.ammo_taurus = bound(0, pl.ammo_taurus + 10, MAX_A_TAURUS);
item_ammo::touch(); item_ammo::Touch(eToucher);
} }
} }
} }
@ -146,7 +146,7 @@ Same as ammo_einar1
class ammo_th_sniper:item_ammo class ammo_th_sniper:item_ammo
{ {
void(void) ammo_th_sniper; void(void) ammo_th_sniper;
virtual void(void) touch; virtual void(entity) Touch;
}; };
void void
@ -156,7 +156,7 @@ ammo_th_sniper::ammo_th_sniper(void)
item_ammo::item_ammo(); item_ammo::item_ammo();
} }
void void
ammo_th_sniper::touch(void) ammo_th_sniper::Touch(entity eToucher)
{ {
if not (other.flags & FL_CLIENT) { if not (other.flags & FL_CLIENT) {
return; return;
@ -165,7 +165,7 @@ ammo_th_sniper::touch(void)
player pl = (player)other; player pl = (player)other;
if (pl.ammo_sniper < MAX_A_SNIPER) { if (pl.ammo_sniper < MAX_A_SNIPER) {
pl.ammo_sniper = bound(0, pl.ammo_sniper + 5, MAX_A_SNIPER); pl.ammo_sniper = bound(0, pl.ammo_sniper + 5, MAX_A_SNIPER);
item_ammo::touch(); item_ammo::Touch(eToucher);
} }
} }
} }

View file

@ -29,11 +29,11 @@ class item_healthkit:CBaseEntity
{ {
void(void) item_healthkit; void(void) item_healthkit;
virtual void(void) Respawn; virtual void(void) Respawn;
virtual void(void) touch; virtual void(entity) Touch;
}; };
void void
item_healthkit::touch(void) item_healthkit::Touch(entity eToucher)
{ {
if (other.classname != "player") { if (other.classname != "player") {
return; return;