(Actually, it probably doesn't matter because all the references were moved inside the situational checks, but it's better to use the event parameters anyway)
What's really weird is sometimes it works just fine, even in client-side stuff