Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Actual Simple fix for Invalid pointer when entering some portals

Status
Not open for further replies.
Junior Spellweaver
Joined
Apr 6, 2008
Messages
181
Reaction score
0
Just replace your original Maps::changeMap function with the following. That's it, nothing more or less. Changes are in bold.

Maps.cpp
Code:
void Maps::changeMap(Player* player, int mapid, int pos){
	[b]if(mapid == 999999999 || mapid < 0){
		mapid = player->getMap();
		pos = 0;
	}[/b]
	removePlayer(player);
	player->setMap(mapid);
	player->setMappos(pos);
	player->setType(0);
	Pos cpos;
	if((unsigned int)pos<info[mapid].Portals.size()){
		cpos.x = info[mapid].Portals[pos].x;
		cpos.y = info[mapid].Portals[pos].y;
	}
	else if(info[mapid].Portals.size() > 0){
		cpos.x = info[mapid].Portals[0].x;
		cpos.y = info[mapid].Portals[0].y;
	}
	else{
		cpos.x = 0;
		cpos.y = 0;
	}
	player->setPos(cpos);
	MapPacket::changeMap(player);
	newMap(player);
}

I got sad watching everyone reinvent the wheel, so I am releasing this simplicity. Cheers. =]
 
Experienced Elementalist
Joined
Apr 6, 2008
Messages
296
Reaction score
3
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

Thanks doyos, Never seem to let us down ;D
 
Newbie Spellweaver
Joined
Apr 20, 2008
Messages
51
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

u pwn doyos. thx for this :p appreciate it.

edit: now only if u were kind enuff to release a tut on how to get sharp eyes to work :p..
 
Junior Spellweaver
Joined
Apr 17, 2008
Messages
103
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

this was posted a while back too lol i have it on my server works like a charm <3
 
Experienced Elementalist
Joined
Oct 26, 2006
Messages
260
Reaction score
62
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

what map does this warp ppl to?
Look at the bold closely and see what happens if you change something in there to make it teleport you to like say henesys(100000000)
(BTW, this is about one of the easiest things to make and I laughed when they released those other scripts to fix invalid pointer) :p.
 
Junior Spellweaver
Joined
Apr 6, 2008
Messages
181
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

what map does this warp ppl to?
Just look at the code. Warps em to the map they're in. :p
 
Newbie Spellweaver
Joined
Apr 8, 2008
Messages
92
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

hey doyos, can u fix the portal in gmsdb that brings u in ana out of the 4th job map?
 
Newbie Spellweaver
Joined
Aug 21, 2006
Messages
36
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

Good release, I'll install it to my server after I check few other stuff I added <3
 
Junior Spellweaver
Joined
Apr 6, 2008
Messages
181
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

hey doyos, can u fix the portal in gmsdb that brings u in ana out of the 4th job map?
What are you talking about? The 4th job portal works fine. If you do not have the latest version of the DB, it might not, but I already stated to UPGRADE BEFORE posting bugs. The new versions are not there to introduce new instability, they're there to fix bugs and add STABILITY. Cheers.
 
Newbie Spellweaver
Joined
Apr 8, 2008
Messages
92
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

dun nid so fierce -__- anyway i'll upgrade
 
Experienced Elementalist
Joined
Apr 13, 2008
Messages
211
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

lol
but i wanted to make something else...
gotta find the old one that take you to henesys...
 
Initiate Mage
Joined
Apr 27, 2008
Messages
1
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

ummm when i coded this in it worked fine but then i donno something happened like i went to enter a portal and like i kept getting warp to the same map non-stop. It's like i was changing channels really fast but then i was on the same map just relogging myself to the same map again and again and i cant make it stop. i have to end task the program. any help?
 
Master Summoner
Joined
Apr 2, 2008
Messages
538
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

thanks for this :x
 
Newbie Spellweaver
Joined
Oct 3, 2005
Messages
37
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

thanks for the release. like always :)
 
Newbie Spellweaver
Joined
Apr 24, 2008
Messages
7
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

Code:
void Maps::changeMap(Player* player, int mapid, int pos){
	if(mapid == 999999999 || mapid < 0){
		mapid = player->getMap();
		pos = 0;
	}
	removePlayer(player);
	player->setMap(mapid); [b]<--- do i change this only?[/b]
	player->setMappos(pos);
	player->setType(0);
	Pos cpos;
	if((unsigned int)pos<info[mapid].Portals.size()){
		cpos.x = info[mapid].Portals[pos].x;
		cpos.y = info[mapid].Portals[pos].y;
	}
	else if(info[mapid].Portals.size() > 0){
		cpos.x = info[mapid].Portals[0].x;
		cpos.y = info[mapid].Portals[0].y;
	}
	else{
		cpos.x = 0;
		cpos.y = 0;
	}
	player->setPos(cpos);
	MapPacket::changeMap(player);
	newMap(player);
}
 
Newbie Spellweaver
Joined
Apr 23, 2008
Messages
19
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

ummm when i coded this in it worked fine but then i donno something happened like i went to enter a portal and like i kept getting warp to the same map non-stop. It's like i was changing channels really fast but then i was on the same map just relogging myself to the same map again and again and i cant make it stop. i have to end task the program. any help?
I have the same problem. Any fix for this? :p
 
Experienced Elementalist
Joined
Jul 10, 2006
Messages
235
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

I still get the problem, changing regular maps, not just to map 999999999.
 
Newbie Spellweaver
Joined
Apr 23, 2008
Messages
19
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

I get the problem without changing maps at all. Just stay in a big map and BOOM, invalid pointer. Happens when we use some skills and equips too. Even when we fame. I really hate that error..
 
Newbie Spellweaver
Joined
Apr 20, 2008
Messages
7
Reaction score
0
Re: [Release] Actual Simple fix for Invalid pointer when entering some portals

hi, how do i add extra maps to it

922010000

that map code and

some 14XXXXXXXXX

code also affect my players, so how can i add new map changers to that
 
Status
Not open for further replies.
Back
Top