From 01b24d73eab6b0e708063d82f01ea9bb9296550c Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 3 Mar 2013 19:05:11 +0000 Subject: Player can sit in minecarts (but not move them yet) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1249 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Items/ItemMinecart.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/Items') diff --git a/source/Items/ItemMinecart.h b/source/Items/ItemMinecart.h index 5a2d78774..52dda942c 100644 --- a/source/Items/ItemMinecart.h +++ b/source/Items/ItemMinecart.h @@ -54,19 +54,21 @@ public: } } - cMinecart::ePayload Payload = cMinecart::mpNone; + double x = (double)a_BlockX + 0.5; + double y = (double)a_BlockY + 0.5; + double z = (double)a_BlockZ + 0.5; + cMinecart * Minecart = NULL; switch (m_ItemType) { - case E_ITEM_MINECART: Payload = cMinecart::mpNone; break; - case E_ITEM_CHEST_MINECART: Payload = cMinecart::mpChest; break; - case E_ITEM_FURNACE_MINECART: Payload = cMinecart::mpFurnace; break; + case E_ITEM_MINECART: Minecart = new cEmptyMinecart (x, y, z); break; + case E_ITEM_CHEST_MINECART: Minecart = new cMinecartWithChest (x, y, z); break; + case E_ITEM_FURNACE_MINECART: Minecart = new cMinecartWithFurnace(x, y, z); break; default: { ASSERT(!"Unhandled minecart item"); return false; } } // switch (m_ItemType) - cMinecart * Minecart = new cMinecart(Payload, (double)a_BlockX + 0.5, a_BlockY, (double)a_BlockZ + 0.5); a_World->AddEntity(Minecart); Minecart->Initialize(a_World); return true; -- cgit v1.2.3