check that data has at least one element

master
melvin 2011-06-19 17:30:53 +08:00
parent ed2eb1c8da
commit 91a556386a
1 changed files with 4 additions and 4 deletions

View File

@ -194,10 +194,10 @@ public class MagicEvent implements MagicCopyable {
public long getEventId() {
long[] keys = {
(player != null ? player.getIndex() : 1),
(source != null ? source.getId() : 10),
(action != null ? action.hashCode() : 100),
(data[0] instanceof MagicTarget) ? ((MagicTarget)data[0]).getId() : 1000,
(player != null ? player.getIndex() : 7),
(source != null ? source.getId() : 7),
(action != null ? action.hashCode() : 7),
(data.length > 0 && data[0] instanceof MagicTarget) ? ((MagicTarget)data[0]).getId() : 7,
};
return magic.MurmurHash3.hash(keys);
}