Skip to content
Snippets Groups Projects
Commit b107372f authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix two multiplayer issues:

1) Call update_update() more often when player data changes.
   Should hopefully solve issue with players staying red after a
   battle on other people's screens.
2) When erasing other players, also erase ones that have moved off
   your map.
parent 6d1a18b5
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -321,6 +321,7 @@ function run_ref(sec, fname) ...@@ -321,6 +321,7 @@ function run_ref(sec, fname)
'moveback':function(args) { 'moveback':function(args) {
player.x = player.lastx; player.x = player.lastx;
player.y = player.lasty; player.y = player.lasty;
update_update();
}, },
'numreturn':function(args) { 'numreturn':function(args) {
var ret = 0; var ret = 0;
...@@ -2105,7 +2106,8 @@ function update(skip) { ...@@ -2105,7 +2106,8 @@ function update(skip) {
return; return;
if (u.deleted) if (u.deleted)
return; return;
if (u.map === player.map) { if (u.map === player.map || (other_players[i] !== undefined && other_players[i].map === player.map)) {
if (u.map === player.map)
nop[i] = {x:u.x, y:u.y, map:u.map, onnow:u.onnow, busy:u.busy, battle:u.battle} nop[i] = {x:u.x, y:u.y, map:u.map, onnow:u.onnow, busy:u.busy, battle:u.battle}
// Erase old player pos... // Erase old player pos...
if (other_players[i] !== undefined) { if (other_players[i] !== undefined) {
...@@ -2262,6 +2264,7 @@ function move_player(xoff, yoff) { ...@@ -2262,6 +2264,7 @@ function move_player(xoff, yoff) {
else if (s.reffile !== '' && s.refsection !== '') { else if (s.reffile !== '' && s.refsection !== '') {
run_ref(s.refsection, s.reffile); run_ref(s.refsection, s.reffile);
player.battle = 0; player.battle = 0;
update_update();
if (pending_timeout !== undefined) if (pending_timeout !== undefined)
handle_timeout(pending_timeout); handle_timeout(pending_timeout);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment