Changeset 3138 for code/branches/pch/src/tolua/tolua_event.c
- Timestamp:
- Jun 10, 2009, 4:01:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/tolua/tolua_event.c
r3127 r3138 372 372 static int class_eq_event (lua_State* L) 373 373 { 374 /* copying code from do_operator here to return false when no operator is found */ 375 if (lua_isuserdata(L,1)) 376 { 377 /* Try metatables */ 378 lua_pushvalue(L,1); /* stack: op1 op2 */ 379 while (lua_getmetatable(L,-1)) 380 { /* stack: op1 op2 op1 mt */ 381 lua_remove(L,-2); /* stack: op1 op2 mt */ 382 lua_pushstring(L,".eq"); /* stack: op1 op2 mt key */ 383 lua_rawget(L,-2); /* stack: obj key mt func */ 384 if (lua_isfunction(L,-1)) 385 { 386 lua_pushvalue(L,1); 387 lua_pushvalue(L,2); 388 lua_call(L,2,1); 389 return 1; 390 } 391 lua_settop(L,3); 392 } 393 } 394 395 lua_settop(L, 3); 396 lua_pushboolean(L, 0); 397 return 1; 374 return do_operator(L,".eq"); 398 375 } 399 376
Note: See TracChangeset
for help on using the changeset viewer.