Files

43 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Darklord.js — readClickPoint() (satır 608)
[← Darklord.js](index.md) · [← Master](../../wiki.md)
```javascript
function readClickPoint(data)
{
if (!data) return null;
try
{
var list = data.getList("click");
if (!list) return null;
try
{
if (list.size && list.size() < 2) return null;
}
catch (e1) {}
var x = null;
var y = null;
try { x = Number(list.getFloat(0)); y = Number(list.getFloat(1)); } catch (e2) {}
if (x === null || y === null || isNaN(x) || isNaN(y))
{
try { x = Number(list.get(0)); y = Number(list.get(1)); } catch (e3) {}
}
if (x === null || y === null || isNaN(x) || isNaN(y))
{
try { x = Number(list[0]); y = Number(list[1]); } catch (e4) {}
}
if (x === null || y === null || isNaN(x) || isNaN(y)) return null;
return { x: Math.floor(x), y: Math.floor(y) };
}
catch (e5) {}
return null;
}
```