Skip to content

Commit

Permalink
Fixed message id to avoid conflicts with Defold 1.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
astrochili committed Feb 4, 2024
1 parent c95f952 commit 0364a81
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion game.project
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include_dirs = walker

[project]
title = Kinematic Walker
version = 1.3.1
version = 1.3.2
dependencies#0 = https://github.com/indiesoftby/defold-pointer-lock/archive/refs/tags/2.0.0.zip
dependencies#1 = https://github.com/astrochili/defold-operator/archive/refs/tags/1.5.2.zip
dependencies#2 = https://github.com/astrochili/defold-trenchfold/archive/refs/tags/1.6.1.zip
Expand Down
10 changes: 5 additions & 5 deletions walker/body.script
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ local hashes = require 'walker.hashes'

function on_message(self, message_id, message, sender)
if self.walker then
if message_id == hash 'contact_point_response' then
if message_id == hashes.contact_point_response then
local message = { point = message, sender = sender}
msg.post(self.walker, hashes.contact_point, message)
elseif message_id == hash 'trigger_response' then
msg.post(self.walker, hashes.contact_point_info, message)
elseif message_id == hashes.trigger_response then
local message = { point = message, sender = sender}
msg.post(self.walker, hashes.trigger, message)
msg.post(self.walker, hashes.trigger_info, message)
end
elseif message_id == hash 'walker_here' then
elseif message_id == hashes.walker_here then
self.walker = sender
end
end
6 changes: 4 additions & 2 deletions walker/hashes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
local hashes = {
acquire_input_focus = hash 'acquire_input_focus',
collision_mask = hash 'collision_mask',
contact_point = hash 'contact_point',
contact_point_info = hash 'contact_point_info',
contact_point_response = hash 'contact_point_response',
debug = hash 'debug',
default = hash 'default',
did_init = hash 'did_init',
Expand All @@ -30,7 +31,8 @@ local hashes = {
ray_cast_response = hash 'ray_cast_response',
spectator_mode = hash 'spectator_mode',
teleport = hash 'teleport',
trigger = hash 'trigger',
trigger_info = hash 'trigger_info',
trigger_response = hash 'trigger_response',
unfollow_camera_rotation = hash 'unfollow_camera_rotation',
walker_crouching = hash 'walker_crouching',
walker_falling = hash 'walker_falling',
Expand Down
4 changes: 2 additions & 2 deletions walker/walker.script
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,9 @@ end
function on_message(self, message_id, message, sender)
if message_id == hashes.post_update then
post_update(self)
elseif message_id == hashes.contact_point then
elseif message_id == hashes.contact_point_info then
handle_contact_point(self, message.point, message.sender)
elseif message_id == hashes.trigger then
elseif message_id == hashes.trigger_info then
handle_trigger(self, message.point, message.sender)
elseif message_id == hashes.collision_mask then
self.collision_mask = message
Expand Down

0 comments on commit 0364a81

Please sign in to comment.