MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zEntPlayer_GivePatsSocksCurrentLevel

Function zEntPlayer_GivePatsSocksCurrentLevel

src/SB/Game/zEntPlayer.cpp:4693–4721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4691}
4692
4693void zEntPlayer_GivePatsSocksCurrentLevel(S32 quantity)
4694{
4695 U32 level = zSceneGetLevelIndex();
4696
4697 if (quantity < 0 && -quantity > (S32)globals.player.Inv_PatsSock_Total)
4698 {
4699 globals.player.Inv_PatsSock_Total = 0;
4700 }
4701 else
4702 {
4703 globals.player.Inv_PatsSock_Total += quantity;
4704 }
4705
4706 if (quantity < 0 && -quantity > (S32)globals.player.Inv_PatsSock[level])
4707 {
4708 globals.player.Inv_PatsSock[level] = 0;
4709 }
4710 else
4711 {
4712 globals.player.Inv_PatsSock[level] += quantity;
4713 }
4714
4715 globals.player.Inv_PatsSock_CurrentLevel = globals.player.Inv_PatsSock[level];
4716
4717 if (quantity > 0)
4718 {
4719 zNPCMsg_AreaNotify(NULL, NPC_MID_PLYRSPATULA, 30.0f, 0x104, NPC_TYPE_UNKNOWN);
4720 }
4721}
4722
4723void zEntPlayer_GiveLevelPickupCurrentLevel(S32 quantity)
4724{

Callers 1

zEntPickup_GivePickupFunction · 0.70

Calls 2

zSceneGetLevelIndexFunction · 0.85
zNPCMsg_AreaNotifyFunction · 0.70

Tested by

no test coverage detected