Path: utzoo!utgpu!attcan!uunet!munnari!moncskermit!moncsbruce!cjs From: cjs@moncsbruce.oz (Chris Stuart) Newsgroups: comp.sources.games.bugs Subject: Re: Omega's random character bug Message-ID: <486@moncsbruce.oz> Date: 1 Aug 88 15:38:50 GMT References: <485@moncsbruce.oz> Organization: Comp Sci, Monash Uni, Australia Lines: 80 From article <485@moncsbruce.oz>, by cjs@moncsbruce.oz (Chris Stuart): > This patch is a hack > from someone who is not at sure what he is doing, but thinks it looks > better this way. Oops. The patch i posted earlier is not sufficient. I post another better one, but i also regard this as a temporary hack until Lawrence Brothers casts his expert eye over the problem and posts the 7.2 bugfixes sometime in the future. This patch adds a new static variables for tracking the type of the environment: i won't be a bit surprised if it can be done better. *** oscr.orig Tue Aug 2 00:31:52 1988 --- oscr.new Tue Aug 2 01:30:29 1988 *************** *** 369,374 void drawplayer() { static int lastx= -1,lasty= -1; if (Current_Environment == E_COUNTRYSIDE) { wmove(Levelw,screenmod(lasty),lastx); waddch(Levelw,Country[lastx][lasty].current_terrain_type); --- 369,375 ----- void drawplayer() { static int lastx= -1,lasty= -1; + static int lastenv = -1; if (Current_Environment == E_COUNTRYSIDE) { if(lastenv == Current_Environment){ wmove(Levelw,screenmod(lasty),lastx); *************** *** 370,377 { static int lastx= -1,lasty= -1; if (Current_Environment == E_COUNTRYSIDE) { ! wmove(Levelw,screenmod(lasty),lastx); ! waddch(Levelw,Country[lastx][lasty].current_terrain_type); wmove(Levelw,screenmod(Player.y),Player.x); waddch(Levelw,PLAYER); } --- 371,380 ----- static int lastx= -1,lasty= -1; static int lastenv = -1; if (Current_Environment == E_COUNTRYSIDE) { ! if(lastenv == Current_Environment){ ! wmove(Levelw,screenmod(lasty),lastx); ! waddch(Levelw,Country[lastx][lasty].current_terrain_type); ! } wmove(Levelw,screenmod(Player.y),Player.x); waddch(Levelw,PLAYER); } *************** *** 384,389 } lastx = Player.x; lasty = Player.y; } int litroom(x,y) --- 387,393 ----- } lastx = Player.x; lasty = Player.y; + lastenv = Current_Environment; } int litroom(x,y) I also note that there are serious problems with two handed weapons. In particular, if you drop one which is in use, you get two copies: the one dropped from the left hand, and the one retained in the right hand. The allocated space may also be freed, i think, leading to more problems. Anyone attempted to patch this should give very careful thought to the appropriate correctness assertions to be maintained by the code. Cheers, Christopher Stuart