Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old November 2, 2015, 15:56   #1
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 1,973
PowerWyrm is on a distinguished road
Commit c108115 breaks teleport other

Before this commit, the new location of the monster was put in project_m_x and project_m_y, but since these have been removed, the code now uses the old location.
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old November 2, 2015, 20:09   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,566
Donated: $60
Nick is on a distinguished road
Really? I can't see that this is the case from the code, and teleport other till seems to be working for me.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old November 3, 2015, 12:18   #3
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 1,973
PowerWyrm is on a distinguished road
Old code:

Code:
	/* Check for NULL, since polymorph can occasionally return NULL. */
	if (mon != NULL) {
		/* Update the monster */
		if (!mon_died) update_mon(mon, cave, FALSE);

		/* Hack -- get new location in case of teleport */ <-- changes x and y
		y = mon->fy;
		x = mon->fx;

		/* Redraw the monster grid */
		square_light_spot(cave, y, x);

		/* Update monster recall window */
		if (player->upkeep->monster_race == mon->race) {
			/* Window stuff */
			player->upkeep->redraw |= (PR_MONSTER);
		}
	}

	/* Track it */
	project_m_n++;
	project_m_x = x;
	project_m_y = y;
New code:

Code:
	/* Track it */
	*did_hit = true;
The new code doesn't use the new location in case of teleport other. Then in project():

Code:
	/* Check monsters */
	if (flg & (PROJECT_KILL)) {
		bool was_obvious = false;
		bool did_hit = false;
		int num_hit = 0;
		int last_hit_x = 0;
		int last_hit_y = 0;

		/* Scan for monsters */
		for (i = 0; i < num_grids; i++) {
			/* Get the grid location */
			y = blast_grid[i].y;
			x = blast_grid[i].x;
			
			/* Check this monster hasn't been processed already */
			if (!square_isproject(cave, y, x)) continue;

			/* Affect the monster in the grid */
			project_m(who, distance_to_grid[i], y, x,
			          dam_at_dist[distance_to_grid[i]], typ, flg,
			          &did_hit, &was_obvious);
			if (was_obvious)
				notice = TRUE;
			if (did_hit) {
				num_hit++;
				last_hit_x = x; <-- old coordinates
				last_hit_y = y;
			}
		}

		/* Player affected one monster (without "jumping") */
		if ((who < 0) && (num_hit == 1) && !(flg & (PROJECT_JUMP))) {
			/* Location */
			x = last_hit_x; <-- old coordinates
			y = last_hit_y;

			/* Track if possible */ <-- does nothing in case of teleport, since the coordinates have changed
			if (cave->squares[y][x].mon > 0) {
				struct monster *mon = square_monster(cave, y, x);

				/* Recall and track */
				if (mflag_has(mon->mflag, MFLAG_VISIBLE)) {
					monster_race_track(player->upkeep, mon->race);
					health_track(player->upkeep, mon);
				}
			}
		}
	}
__________________
PWMAngband variant maintainer - check http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old November 3, 2015, 20:18   #4
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,566
Donated: $60
Nick is on a distinguished road
Oh, right, it's the teleport effects of things like Nexus - I was just looking at the Teleport Other spell.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[3.5-dev] Typo in last commit for teleport level PowerWyrm Vanilla 1 May 21, 2013 14:45
Teleport other UglySquirrell Vanilla 0 September 23, 2011 11:25
Teleport Level breaks game balance buzzkill Development 29 June 28, 2011 21:08
Teleport Other, too powerful? buzzkill Vanilla 29 May 4, 2009 22:12
[Un] .. sometimes you better do not teleport .. Arralen AAR 1 August 18, 2008 22:11


All times are GMT +1. The time now is 13:37.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.