summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemSoup.h
blob: 60a2f8d7687bbdf8c623fe284e57f9b13ac8449a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#pragma once

#include "ItemFood.h"
#include "../World.h"





class cItemSoupHandler:
	public cItemFoodHandler
{
	using Super = cItemFoodHandler;

public:

	cItemSoupHandler(int a_ItemType, FoodInfo a_FoodInfo):
		Super(a_ItemType, a_FoodInfo)
	{

	}

	virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override
	{
		// Skip over food handler, which does removal for us.
		if (!cItemHandler::EatItem(a_Player, a_Item))
		{
			return false;
		}

		if (!a_Player->IsGameModeCreative())
		{
			a_Player->ReplaceOneEquippedItemTossRest(cItem(E_ITEM_BOWL));
		}

		return true;
	}

};