From bb183e9257bd99caeab9776b3579acf68cb203b1 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 1 Oct 2008 17:44:09 +0000 Subject: Reworked traps: much much cleaner now. There might be bugs, though. Traps now remember how much ammo they have. The ammo quantities (from David) are rather tentative. Breaks savefiles. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7076 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tags.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/tags.cc') diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 9df9fccc26..b531fb8b22 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1731,8 +1731,8 @@ static void tag_construct_level_items(writer &th) for (int i = 0; i < MAX_TRAPS; ++i) { marshallByte(th, env.trap[i].type); - marshallByte(th, env.trap[i].pos.x); - marshallByte(th, env.trap[i].pos.y); + marshallCoord(th, env.trap[i].pos); + marshallShort(th, env.trap[i].ammo_qty); } // how many items? @@ -2018,9 +2018,8 @@ static void tag_read_level_items(reader &th, char minorVersion) env.trap[i].type = static_cast( static_cast(unmarshallByte(th)) ); - - env.trap[i].pos.x = unmarshallByte(th); - env.trap[i].pos.y = unmarshallByte(th); + unmarshallCoord(th, env.trap[i].pos); + env.trap[i].ammo_qty = unmarshallShort(th); } // how many items? -- cgit v1.2.3-54-g00ecf