starlit  Diff

Differences From Artifact [d40c92ebbb]:

To Artifact [0ecf5e03a5]:


    82     82   					user:suitSound('starlit-insert-snap')
    83     83   				elseif list == 'starlit_suit_chips' then
    84     84   					--user:suitSound('starlit-suit-chip-out')
    85     85   				elseif list == 'starlit_suit_canisters' then
    86     86   					user:suitSound('starlit-insert-snap')
    87     87   				end
    88     88   			end
           89  +			return true -- move allowed
    89     90   		end;
    90     91   		def = function(self)
    91     92   			return self.item:get_definition()._starlit.suit
    92     93   		end;
    93     94   		--[[
    94     95   		pullCanisters = function(self, inv)
    95     96   			starlit.item.container.dropPrefix(inv, 'starlit_canister')
................................................................................
   284    285   			};
   285    286   			suit = def;
   286    287   		};
   287    288   	});
   288    289   end)
   289    290   
   290    291   local slotProps = {
          292  +-- 	main = {
          293  +-- 		free = true;
          294  +-- 	};
   291    295   	starlit_cfg = {
   292    296   		itemClass = 'inv';
   293    297   	};
   294    298   	starlit_suit_bat = {
   295    299   		suitSlot = true;
   296    300   		powerLock = true;
   297    301   		itemClass = 'dynamo';
................................................................................
   375    379   	return true
   376    380   end)
   377    381   
   378    382   core.register_on_player_inventory_action(function(luser, act, inv, p)
   379    383   	local user = starlit.activeUsers[luser:get_player_name()]
   380    384   	local function slotChange(slot,a,item)
   381    385   		local s = slotProps[slot]
          386  +		local allow = true
   382    387   		if slot == 'starlit_suit' then
   383    388   			user:updateSuit()
   384    389   			if user:naked() then
   385    390   				starlit.type.suit.purgeInventories(user.entity)
   386    391   				user.power.nano = {}
   387    392   			end
   388    393   		elseif s and s.suitSlot then
   389    394   			local s = user:getSuit()
   390         -			s:onItemMove(user, slot, a, item)
   391         -			s:onReconfigure(user.entity:get_inventory())
   392         -			user:setSuit(s)
          395  +			if s:onItemMove(user, slot, a, item) then
          396  +				s:onReconfigure(user.entity:get_inventory())
          397  +				user:setSuit(s)
          398  +			else return end
   393    399   		else return end
   394    400   		user:updateHUD()
   395    401   	end
   396    402   
   397    403   	if act == 'put' or act == 'take' then
   398    404   		local item = p.stack
   399    405   		slotChange(p.listname, act, item)