diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-03 20:05:11 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-03 20:05:11 +0100 |
commit | 01b24d73eab6b0e708063d82f01ea9bb9296550c (patch) | |
tree | 6646ddda7a137b8960484b9fa2614683545e756a /source/Items | |
parent | Simulators are woken up upon chunk load (diff) | |
download | cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.gz cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.bz2 cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.lz cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.xz cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.zst cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.zip |
Diffstat (limited to 'source/Items')
-rw-r--r-- | source/Items/ItemMinecart.h | 12 |
1 files changed, 7 insertions, 5 deletions
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;
|