82 /* When we execute, really make the sign */ |
82 /* When we execute, really make the sign */ |
83 if (flags & DC_EXEC) { |
83 if (flags & DC_EXEC) { |
84 ss->str = STR_280A_SIGN; |
84 ss->str = STR_280A_SIGN; |
85 ss->x = x; |
85 ss->x = x; |
86 ss->y = y; |
86 ss->y = y; |
|
87 ss->owner = p1; |
87 ss->z = GetSlopeZ(x,y); |
88 ss->z = GetSlopeZ(x,y); |
88 UpdateSignVirtCoords(ss); |
89 UpdateSignVirtCoords(ss); |
89 MarkSignDirty(ss); |
90 MarkSignDirty(ss); |
90 _new_sign_struct = ss; |
91 _new_sign_struct = ss; |
91 } |
92 } |
95 |
96 |
96 /** |
97 /** |
97 * Rename a sign |
98 * Rename a sign |
98 * |
99 * |
99 * @param sign_id Index of the sign |
100 * @param sign_id Index of the sign |
100 * @param remove If 1, sign will be removed |
101 * @param new owner, if OWNER_NONE, sign will be removed |
101 */ |
102 */ |
102 int32 CmdRenameSign(int x, int y, uint32 flags, uint32 sign_id, uint32 remove) |
103 int32 CmdRenameSign(int x, int y, uint32 flags, uint32 sign_id, uint32 owner) |
103 { |
104 { |
104 StringID str; |
105 StringID str; |
105 SignStruct *ss; |
106 SignStruct *ss; |
106 |
107 |
107 /* If GetDParam(0) == nothing, we delete the sign */ |
108 /* If GetDParam(0) == nothing, we delete the sign */ |
108 if (GetDParam(0) != 0 && remove != 1) { |
109 if (GetDParam(0) != 0 && owner != OWNER_NONE) { |
109 /* Create the name */ |
110 /* Create the name */ |
110 str = AllocateName((byte*)_decode_parameters, 0); |
111 str = AllocateName((byte*)_decode_parameters, 0); |
111 if (str == 0) |
112 if (str == 0) |
112 return CMD_ERROR; |
113 return CMD_ERROR; |
113 |
114 |
163 * sign-tool is selected |
165 * sign-tool is selected |
164 * |
166 * |
165 */ |
167 */ |
166 void PlaceProc_Sign(uint tile) |
168 void PlaceProc_Sign(uint tile) |
167 { |
169 { |
168 DoCommandP(tile, 0, 0, CcPlaceSign, CMD_PLACE_SIGN | CMD_MSG(STR_2809_CAN_T_PLACE_SIGN_HERE)); |
170 DoCommandP(tile, _current_player, 0, CcPlaceSign, CMD_PLACE_SIGN | CMD_MSG(STR_2809_CAN_T_PLACE_SIGN_HERE)); |
169 } |
171 } |
170 |
172 |
171 /** |
173 /** |
172 * |
174 * |
173 * Initialize the signs |
175 * Initialize the signs |
189 SLE_VAR(SignStruct,str, SLE_UINT16), |
191 SLE_VAR(SignStruct,str, SLE_UINT16), |
190 SLE_CONDVAR(SignStruct,x, SLE_FILE_I16 | SLE_VAR_I32, 0, 4), |
192 SLE_CONDVAR(SignStruct,x, SLE_FILE_I16 | SLE_VAR_I32, 0, 4), |
191 SLE_CONDVAR(SignStruct,y, SLE_FILE_I16 | SLE_VAR_I32, 0, 4), |
193 SLE_CONDVAR(SignStruct,y, SLE_FILE_I16 | SLE_VAR_I32, 0, 4), |
192 SLE_CONDVAR(SignStruct,x, SLE_INT32, 5, 255), |
194 SLE_CONDVAR(SignStruct,x, SLE_INT32, 5, 255), |
193 SLE_CONDVAR(SignStruct,y, SLE_INT32, 5, 255), |
195 SLE_CONDVAR(SignStruct,y, SLE_INT32, 5, 255), |
|
196 // SLE_CONDVAR(SignStruct,owner, SLE_INT32, 6, 255), // TODO: uncomment this after the savegame bump to version 6.0 |
194 SLE_VAR(SignStruct,z, SLE_UINT8), |
197 SLE_VAR(SignStruct,z, SLE_UINT8), |
195 SLE_END() |
198 SLE_END() |
196 }; |
199 }; |
197 |
200 |
198 /** |
201 /** |