This is a long standing bug in Pirate101 that many have reported. If you do unfortunately get stuck, you can reset your character location by simply returning to your character selection screen and logging back in with the character that was stuck.
We'll continue searching for a way to fix this bug. Thanks!