Thread View: net.games.hack
1 messages
1 total messages
Started by Mike Schloss
Mon, 23 Dec 1985 18:20
Bug when polymorphing rocks
Author: Mike Schloss
Date: Mon, 23 Dec 1985 18:20
Date: Mon, 23 Dec 1985 18:20
54 lines
2332 bytes
2332 bytes
Greetings fellow hackers. I have a question for you.
I think there is a problem with the code dealing with
polymorphing rocks into gems. The code fragment follows.
switch(otmp->otyp) {
case WAN_POLYMORPH:
/* preserve symbol and quantity, but turn rocks into gems */
mkobj_at((obj->otyp == ROCK || obj->otyp == ENORMOUS_ROCK)
? GEM_SYM : obj->olet,
obj->ox, obj->oy) -> quan = obj->quan;
delobj(obj);
break;
.
.
.
}
What happens is that is turned into a pile of gems with the weight
of one gem. If you then change the number of items in the pile in
any way (say by adding more or dropping some but not all) the weight
will then be correctly calculated. This could result in you not being
able to carry what you've already got in your knapsack. The fix is as
follows:
register struct obj *otmp2;
.
.
.
switch(otmp->otyp) {
case WAN_POLYMORPH:
/* preserve symbol and quantity, but turn rocks into gems */
otmp2 = mkobj_at((obj->otyp == ROCK ||
obj->otyp == ENORMOUS_ROCK) ? GEM_SYM : obj->olet,
obj->ox, obj->oy);
otmp2->quan = obj->quan;
otmp2->owt = obj->owt;
delobj(obj);
break;
.
.
.
}
I know this prevents people from collecting millions of Zorkmids worth
of gems but should one be able to do this. They should weigh something.
It seems though that a gem that weighs the same amount as a rock suitable
as a weapon (without a sling) should be worth alot. When polymorphing a
rock into a gem does it's size change. If you polymorph a dragon corpse
into a tripe ration I would expect it's size to change. Similarly with
other monsters. Any comments... How about you A.B.
Mike
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads