Skip to content

Commit

Permalink
fix pvp losses in library, fix undefined screen handling for safari <…
Browse files Browse the repository at this point in the history
…16.4
  • Loading branch information
serprex committed Feb 21, 2024
1 parent 898bcfc commit 6374fb5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -16,7 +16,7 @@
"html-webpack-plugin": "^5.6.0",
"prettier": "^3.2.5",
"solid-js": "^1.8.15",
"webpack": "^5.90.2",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/rs/src/skill.rs
Expand Up @@ -1945,7 +1945,7 @@ impl Skill {
}
});
ctx.spelldmg(foe, dmg);
ctx.poison(foe, ctx.get(t, Stat::poison) + ctx.get(t, Flag::poisonous) as i16);
ctx.poison(foe, poison);
}
Self::counter => {
if ctx.get(c, Stat::frozen) == 0
Expand Down
9 changes: 6 additions & 3 deletions src/views/Match.jsx
Expand Up @@ -805,7 +805,8 @@ export default function Match(props) {
hardcorebound = props.game.data.ante.bound;
}
const [landscape, setLandscape] = createSignal(
!screen.orientation.type.startsWith('portrait'),
typeof screen === 'undefined' ||
!screen.orientation?.type?.startsWith?.('portrait'),
);
const [pgame, setGame] = createSignal(props.game);
const [tempgame, setTempgame] = createSignal(null);
Expand Down Expand Up @@ -1336,7 +1337,8 @@ export default function Match(props) {
};
const setlandscape = e => setLandscape(!e.target.type.startsWith('portrait'));
onMount(() => {
screen.orientation.addEventListener('change', setlandscape);
if (typeof screen !== 'undefined' && screen.orientation)
screen.orientation.addEventListener('change', setlandscape);
if (props.replay) return;
if (!props.game.data.spectate) {
document.addEventListener('keydown', onkeydown);
Expand Down Expand Up @@ -1392,7 +1394,8 @@ export default function Match(props) {

onCleanup(() => {
setCmds({});
screen.orientation.removeEventListener('change', setlandscape);
if (typeof screen !== 'undefined' && screen.orientation)
screen.orientation.removeEventListener('change', setlandscape);
document.removeEventListener('keydown', onkeydown);
window.removeEventListener('beforeunload', onbeforeunload);
});
Expand Down

0 comments on commit 6374fb5

Please sign in to comment.